Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kvarada committed Nov 21, 2023
1 parent 3b68fd3 commit bfccee9
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 41 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 4 additions & 12 deletions _sources/lectures/19_time-series.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3113,7 +3113,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Recall that we are working with the bike rentals data in August 2015. "
"Recall that we are working with the bike rentals data from August 2015. "
]
},
{
Expand Down Expand Up @@ -3552,14 +3552,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"With a linear model and lag features we get the following scores. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's split the data and train a model "
"Let's split the data and train a linear model. "
]
},
{
Expand Down Expand Up @@ -3600,7 +3593,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Given this, we can now predict the sales"
"Given this, we can now predict `n_rentals` on the test data. "
]
},
{
Expand Down Expand Up @@ -3952,8 +3945,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"- There are a few approaches which could be employed:\n",
"\n",
"There are a few approaches which could be employed:\n",
"1. Train a separate model for each number of 3-hour span. E.g. one model that predicts `n_rentals` for next three hours, another model that predicts `n_rentals` in six hours, etc. We can build these datasets.\n",
"2. Use a multi-output model that jointly predicts `n_rentalsIn3hours`, `n_rentalsIn6hours`, etc. However, multi-output models are outside the scope of CPSC 330. \n",
"3. Use one model and sequentially predict using a `for` loop. "
Expand Down
2 changes: 1 addition & 1 deletion lectures/17_natural-language-processing.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ <h2>Imports<a class="headerlink" href="#imports" title="Permalink to this headin
Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.
</pre></div>
</div>
<img alt="../_images/9c759640708ffd780a2033fc82ecb7ee37d4c5e87c40416e79857cc2b057a8a6.png" src="../_images/9c759640708ffd780a2033fc82ecb7ee37d4c5e87c40416e79857cc2b057a8a6.png" />
<img alt="../_images/61c7334b48e238985956ba66ede1c3745130fde2f241bf07ad14b3f318a2d24f.png" src="../_images/61c7334b48e238985956ba66ede1c3745130fde2f241bf07ad14b3f318a2d24f.png" />
</div>
</div>
<div class="cell docutils container">
Expand Down
45 changes: 20 additions & 25 deletions lectures/19_time-series.html
Original file line number Diff line number Diff line change
Expand Up @@ -1074,9 +1074,7 @@ <h3>Extracting date and time information<a class="headerlink" href="#extracting-
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Train-set R^2: 0.89
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Test-set R^2: 0.84
Test-set R^2: 0.84
</pre></div>
</div>
<img alt="../_images/2508eaa9c6ff31d91314c9732a9f8a466811ed107928bbfb6e12fedeb822f988.png" src="../_images/2508eaa9c6ff31d91314c9732a9f8a466811ed107928bbfb6e12fedeb822f988.png" />
Expand Down Expand Up @@ -2328,11 +2326,11 @@ <h2>Lag-based features<a class="headerlink" href="#lag-based-features" title="Pe
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Train-set R^2: 0.95
Test-set R^2: 0.70
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Train-set R^2: 0.94
Test-set R^2: 0.69
</pre></div>
</div>
<img alt="../_images/2e02641f40813fc63e8d99228c288ffe9f8dcc93caeffbe4cf36b043c101e198.png" src="../_images/2e02641f40813fc63e8d99228c288ffe9f8dcc93caeffbe4cf36b043c101e198.png" />
<img alt="../_images/e417bc322c2d5f45c26fef85d8149e47dea18d0086601724795dd4371655590f.png" src="../_images/e417bc322c2d5f45c26fef85d8149e47dea18d0086601724795dd4371655590f.png" />
</div>
</div>
<p>The results are better than <code class="docutils literal notranslate"><span class="pre">Ridge</span></code> with lag features but they are not as good as the results with our previously engineered features. How about combining lag-based features and the previously extracted features?</p>
Expand All @@ -2351,11 +2349,11 @@ <h2>Lag-based features<a class="headerlink" href="#lag-based-features" title="Pe
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Train-set R^2: 0.96
Test-set R^2: 0.79
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Train-set R^2: 0.95
Test-set R^2: 0.77
</pre></div>
</div>
<img alt="../_images/b1a63308872e88f69ad65ace6c5c2f591708eaf64eef5687c721358f653a7fac.png" src="../_images/b1a63308872e88f69ad65ace6c5c2f591708eaf64eef5687c721358f653a7fac.png" />
<img alt="../_images/5adcf6f71245dc2af25579426397569bfabc368c6ff2b11bbb55fd3dd9b00575.png" src="../_images/5adcf6f71245dc2af25579426397569bfabc368c6ff2b11bbb55fd3dd9b00575.png" />
</div>
</div>
<p>Some improvement but we are getting better results without the lag features in this case.</p>
Expand Down Expand Up @@ -2455,35 +2453,35 @@ <h3>Cross-validation<a class="headerlink" href="#cross-validation" title="Permal
<tbody>
<tr>
<th>0</th>
<td>0.001093</td>
<td>0.000283</td>
<td>0.001298</td>
<td>0.000331</td>
<td>0.642676</td>
<td>0.873182</td>
</tr>
<tr>
<th>1</th>
<td>0.000548</td>
<td>0.000228</td>
<td>0.000765</td>
<td>0.000313</td>
<td>0.828405</td>
<td>0.874305</td>
</tr>
<tr>
<th>2</th>
<td>0.000899</td>
<td>0.000217</td>
<td>0.000902</td>
<td>0.000316</td>
<td>0.773851</td>
<td>0.901262</td>
</tr>
<tr>
<th>3</th>
<td>0.000907</td>
<td>0.000218</td>
<td>0.001197</td>
<td>0.000282</td>
<td>0.696712</td>
<td>0.889429</td>
</tr>
<tr>
<th>4</th>
<td>0.001037</td>
<td>0.001477</td>
<td>0.000735</td>
<td>0.892733</td>
<td>0.863889</td>
Expand All @@ -2497,7 +2495,7 @@ <h3>Cross-validation<a class="headerlink" href="#cross-validation" title="Permal
</section>
<section id="forecasting-further-into-the-future">
<h2>Forecasting further into the future<a class="headerlink" href="#forecasting-further-into-the-future" title="Permalink to this heading">#</a></h2>
<p>Recall that we are working with the bike rentals data in August 2015.</p>
<p>Recall that we are working with the bike rentals data from August 2015.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">citibike</span>
Expand Down Expand Up @@ -2822,8 +2820,7 @@ <h2>Forecasting further into the future<a class="headerlink" href="#forecasting-
</div>
</div>
</div>
<p>With a linear model and lag features we get the following scores.</p>
<p>Let’s split the data and train a model</p>
<p>Let’s split the data and train a linear model.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># split the given features into a training and a test set</span>
Expand Down Expand Up @@ -2851,7 +2848,7 @@ <h2>Forecasting further into the future<a class="headerlink" href="#forecasting-
</div>
</div>
</div>
<p>Given this, we can now predict the sales</p>
<p>Given this, we can now predict <code class="docutils literal notranslate"><span class="pre">n_rentals</span></code> on the test data.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">X_test</span>
Expand Down Expand Up @@ -3118,9 +3115,7 @@ <h2>Forecasting further into the future<a class="headerlink" href="#forecasting-
</ul>
</li>
</ul>
<ul class="simple">
<li><p>There are a few approaches which could be employed:</p></li>
</ul>
<p>There are a few approaches which could be employed:</p>
<ol class="arabic simple">
<li><p>Train a separate model for each number of 3-hour span. E.g. one model that predicts <code class="docutils literal notranslate"><span class="pre">n_rentals</span></code> for next three hours, another model that predicts <code class="docutils literal notranslate"><span class="pre">n_rentals</span></code> in six hours, etc. We can build these datasets.</p></li>
<li><p>Use a multi-output model that jointly predicts <code class="docutils literal notranslate"><span class="pre">n_rentalsIn3hours</span></code>, <code class="docutils literal notranslate"><span class="pre">n_rentalsIn6hours</span></code>, etc. However, multi-output models are outside the scope of CPSC 330.</p></li>
Expand Down
2 changes: 1 addition & 1 deletion lectures/class_demos/14_class-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ <h2>Let’s cluster images!!<a class="headerlink" href="#let-s-cluster-images" t
Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.
</pre></div>
</div>
<img alt="../../_images/a29ab0c1c8b3f9faac72155eba8acda8325935b0b20ef3ca8147a8990dece720.png" src="../../_images/a29ab0c1c8b3f9faac72155eba8acda8325935b0b20ef3ca8147a8990dece720.png" />
<img alt="../../_images/5b39903db0485a9b21537a0d7b86bb2f9c84024f110548905eb790e2738a6846.png" src="../../_images/5b39903db0485a9b21537a0d7b86bb2f9c84024f110548905eb790e2738a6846.png" />
</div>
</div>
<div class="cell docutils container">
Expand Down
2 changes: 1 addition & 1 deletion lectures/class_demos/15_class-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ <h1>Lecture 15: Class demo<a class="headerlink" href="#lecture-15-class-demo" ti
Intel MKL WARNING: Support of Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library 2025.0 will require Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.
</pre></div>
</div>
<img alt="../../_images/e2fe763812d809afff93df27aae401a5bf6fa8851f8e7d30787b2e0950bd43fd.png" src="../../_images/e2fe763812d809afff93df27aae401a5bf6fa8851f8e7d30787b2e0950bd43fd.png" />
<img alt="../../_images/772fe5fc68484659778e0c3c1e983081dd53124d48f9db48e5ee38933a13389b.png" src="../../_images/772fe5fc68484659778e0c3c1e983081dd53124d48f9db48e5ee38933a13389b.png" />
</div>
</div>
<div class="cell docutils container">
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit bfccee9

Please sign in to comment.