Updating slides

This commit is contained in:
Oliver Kennedy 2022-04-02 12:11:36 -04:00
parent ad0c28d2d7
commit 64a4947ef3
Signed by: okennedy
GPG key ID: 3E5F9B3ABD3FDB60
5 changed files with 500 additions and 3047 deletions

View file

@ -77,7 +77,6 @@ title: "UB Hacking: Microkernel Notebooks"
WHERE l.orderkey = o.orderkey
AND o.orderdate > DATE(NOW() - '1 Month')
</code></pre>
<div class="fragment" style="font-size: 70%;">
<pre><code class="sql">
SELECT partkey FROM salesSinceLastMonth
ORDER BY shipdate DESC LIMIT 10;
@ -88,17 +87,61 @@ title: "UB Hacking: Microkernel Notebooks"
GROUP BY suppkey;
</code></pre>
<pre><code class="sql">
SELECT partkey, COUNT(*)
SELECT DISTINCT partkey
FROM salesSinceLastMonth
GROUP BY partkey;
</code></pre>
</div>
</section>
<section>
<pre><code class="python">
def really_expensive_computation():
return [
expensive_computation(i)
for i in range(1, 1000000):
if expensive_test(i)
]
</code></pre>
<pre><code class="python">
print(sorted(really_expensive_computation())[:10])
</code></pre>
<pre><code class="python">
print(len(really_expensive_computation()))
</code></pre>
<pre><code class="python">
print(set(really_expensive_computation()))
</code></pre>
</section>
<section>
<p><b>Opportunity:</b> Views exist to be queried frequently</p>
<p><b>Opportunity:</b> Views are queried frequently</p>
<p class="fragment"><b>Idea: </b> Pre-compute and save the views contents!</p>
</section>
<section>
<pre><code class="python">
def really_expensive_computation():
return [
expensive_computation(i)
for i in range(1, 1000000):
if expensive_test(i)
]
view = really_expensive_computation()
</code></pre>
<pre><code class="python">
print(sorted(view)[:10])
</code></pre>
<pre><code class="python">
print(len(view))
</code></pre>
<pre><code class="python">
print(set(view))
</code></pre>
</section>
<section>
<p>Btw... the last slide was the essence of CSE 250.</p>
</section>
<section>
<svg data-src="graphics/2022-04-02/DBToQ.svg" />
@ -196,11 +239,7 @@ title: "UB Hacking: Microkernel Notebooks"
<img src="graphics/logos/jupyter.svg" height="500px">
<img src="graphics/2022-04-02/jupyter.png" height="500px">
</section>
<section>
<img src="graphics/2022-04-02/jupyter.png" height="500px">
</section>
<section>
<pre><code class="python">
import pandas as pd
@ -307,20 +346,22 @@ title: "UB Hacking: Microkernel Notebooks"
<pre><code class="python">
df = pd.read_csv("really_big_dataset.csv")
</code></pre>
<pre><code class="python">
<pre style="box-shadow: 0px 0px 12px red; "><code class="python">
test = df.iloc[:500]
train = df.iloc[500:]
</code></pre>
<pre class="fragment red-shadow-current"><code class="python">
<pre class="fragment red-shadow-current" data-fragment-index="1"><code class="python">
model = train_linear_regression(train, "target")
</code></pre>
<pre class="fragment red-shadow-current"><code class="python">
<pre class="fragment red-shadow-current" data-fragment-index="1"><code class="python">
evaluate_linear_regresion(model, test, "target")
</code></pre>
</section>
<section>
<h3>In a script...</h3>
<h3>Q1: Which cells need to be re-evaluated?</h3>
<p style="margin-top: 100px; font-weight: bold;" class="fragment">Idea 1: All of them!</p>
</section>
<section>
@ -343,21 +384,29 @@ title: "UB Hacking: Microkernel Notebooks"
</section>
<section>
<p><tt>df</tt> is still around, and you can "re-use" it.</p>
<p>... but <tt>df</tt> is still around, and you can "re-use" it.</p>
<p style="margin-top: 100px; font-weight: bold;" class="fragment">... but <u>you</u> need to know that.</p>
<p style="margin-top: 100px; font-weight: bold;" class="fragment">... but <u class="fragment highlight-red">you</u> need to know that.</p>
</section>
</section>
<section>
<section>
<p>Idea 2: Pull out your CSE 443 Textbooks</p>
</section>
<section>
<svg data-src="graphics/2022-04-02/data-flow-simple.svg" height="500px" />
</section>
<section>
<h2>Data Flow Graph</h2>
<p>Cell 3 changed, so re-evaluate only cells 4 and 5</p>
<p style="margin-top: 100px; font-weight: bold;" class="fragment">... but</p>
</section>
<section>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View file

@ -25,9 +25,9 @@
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="1.4948513"
inkscape:cx="264.24033"
inkscape:cy="358.5641"
inkscape:window-width="1920"
inkscape:cx="113.05472"
inkscape:cy="465.59815"
inkscape:window-width="1090"
inkscape:window-height="1011"
inkscape:window-x="1080"
inkscape:window-y="306"
@ -486,5 +486,60 @@
rx="49.2808"
ry="3.8364925" />
</g>
<text
xml:space="preserve"
style="font-size:5.29167px;line-height:1.25;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;stroke-width:0.264583"
x="0.55351955"
y="5.0688901"
id="text5106"><tspan
sodipodi:role="line"
id="tspan5104"
style="font-weight:bold;font-size:5.29167px;stroke-width:0.264583"
x="0.55351955"
y="5.0688901">[1]</tspan></text>
<text
xml:space="preserve"
style="font-size:5.29167px;line-height:1.25;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;stroke-width:0.264583"
x="0.55351955"
y="42.110558"
id="text8688"><tspan
sodipodi:role="line"
id="tspan8686"
style="font-weight:bold;font-size:5.29167px;stroke-width:0.264583"
x="0.55351955"
y="42.110558">[2]</tspan></text>
<text
xml:space="preserve"
style="font-size:5.29167px;line-height:1.25;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;stroke-width:0.264583"
x="0.55351955"
y="76.506393"
id="text8794"><tspan
sodipodi:role="line"
id="tspan8792"
style="font-weight:bold;font-size:5.29167px;stroke-width:0.264583"
x="0.55351955"
y="76.506393">[3]</tspan></text>
<text
xml:space="preserve"
style="font-size:5.29167px;line-height:1.25;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;stroke-width:0.264583"
x="0.55351955"
y="114.60635"
id="text8900"><tspan
sodipodi:role="line"
id="tspan8898"
style="font-weight:bold;font-size:5.29167px;stroke-width:0.264583"
x="0.55351955"
y="114.60635">[4]</tspan></text>
<text
xml:space="preserve"
style="font-size:5.29167px;line-height:1.25;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;letter-spacing:0px;stroke-width:0.264583;word-spacing:0px"
x="0.55351955"
y="150.58965"
id="text9006"><tspan
sodipodi:role="line"
id="tspan9004"
style="font-weight:bold;font-size:5.29167px;stroke-width:0.264583"
x="0.55351955"
y="150.58965">[5]</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 20 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 141 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 143 KiB