This commit is contained in:
Morten Hjorth-Jensen
2024-10-08 17:04:26 +02:00
parent 87d1e4455c
commit dbbebedb06
114 changed files with 3736 additions and 1751 deletions
+45 -35
View File
@@ -308,6 +308,21 @@ const thebe_selector_output = ".output, .cell_output"
Week 39: Optimization and Gradient Methods
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="week40.html">
Week 40: Gradient descent methods (continued) and start Neural networks
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="exercisesweek41.html">
Exercises week 41
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="week41.html">
Week 41 Neural networks and constructing a neural network code
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
@@ -320,6 +335,11 @@ const thebe_selector_output = ".output, .cell_output"
Project 1 on Machine Learning, deadline October 7 (midnight), 2024
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="project2.html">
Project 2 on Machine Learning, deadline November 4 (Midnight)
</a>
</li>
</ul>
</div>
@@ -1651,7 +1671,7 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.9952505213910134
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.9960887274532307
</pre></div>
</div>
</div>
@@ -1668,7 +1688,7 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.008753288788081405
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.010148621093080332
</pre></div>
</div>
</div>
@@ -1683,31 +1703,23 @@ Since we are not using <strong>Scikit-Learn</strong> here we can define our own
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[8.90304177e-02 3.21655059e-02 1.15924557e-02 1.83823317e-02
8.19559737e-03 1.66018725e-02 1.79135536e-03 1.03313259e-01
7.69182892e-04 1.29306584e-02 1.21565007e-02 2.83463634e-03
3.03538673e-02 2.37415625e-02 1.56790195e-02 9.03400724e-03
1.35613536e-02 5.35506347e-02 1.01123792e-02 4.10604579e-02
2.63898112e-02 1.94766419e-02 3.81425129e-02 3.27482829e-02
5.12829994e-03 6.02901273e-03 8.26321660e-02 4.04504728e-02
2.20601797e-02 4.62113349e-03 9.03476611e-04 4.87494456e-02
3.82060913e-03 2.53729411e-02 2.38612299e-02 1.59355752e-02
3.60160003e-03 1.65738717e-02 2.98947674e-02 5.18501900e-03
9.36303682e-03 4.81218742e-02 1.49392067e-02 4.88551766e-03
2.17643975e-02 2.20608548e-04 1.90135464e-02 2.74291603e-02
1.23344210e-02 6.03309191e-03 1.57252451e-02 9.02612988e-03
3.32084559e-02 3.76692036e-03 2.87169607e-02 4.85551266e-02
1.48826894e-02 6.41842093e-04 1.89017198e-02 3.49584063e-02
1.77652198e-02 6.38298234e-03 1.05034088e-03 1.99753321e-02
5.52031552e-03 8.22217237e-03 6.86192682e-02 8.40354798e-03
1.29491144e-02 7.44658658e-03 1.00731392e-02 9.52284329e-02
1.51437058e-02 2.00002585e-05 2.37700967e-02 1.95166920e-02
4.82376174e-02 3.73986200e-02 4.84707251e-02 8.76887316e-02
2.74724414e-02 5.14825560e-03 1.26254957e-02 2.81042619e-02
2.11265643e-02 2.52301447e-03 3.13819592e-02 2.93900569e-02
3.65720152e-02 1.02850506e-02 4.85945208e-02 2.79870689e-02
3.12846660e-02 6.17869861e-02 9.09590269e-03 1.11715109e-02
3.62863106e-02 1.21277816e-02 9.05665429e-03 4.85293303e-02]
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.01006224 0.02667406 0.0272743 0.00100202 0.01480927 0.00410183
0.02088307 0.02506901 0.00463124 0.00672505 0.0304378 0.00076521
0.05364579 0.01232366 0.00969623 0.00677215 0.02239876 0.03858916
0.00923474 0.00848739 0.01701429 0.07172932 0.08858739 0.04575775
0.02988432 0.00988356 0.01546126 0.00033415 0.03201922 0.01425384
0.00575681 0.01882218 0.05853984 0.00528252 0.03254614 0.03092729
0.01094916 0.05696574 0.03412067 0.02444266 0.05749111 0.0689303
0.00736737 0.02104639 0.00274212 0.00588836 0.05043958 0.01456865
0.01813363 0.06019833 0.01078008 0.01059242 0.02369044 0.02692965
0.00657601 0.01218403 0.03745816 0.05363722 0.00561212 0.03820746
0.00988992 0.00774376 0.03426412 0.01323341 0.02387182 0.01151556
0.01097287 0.07292363 0.02846506 0.04186033 0.00836649 0.00340452
0.06200455 0.03246707 0.02987496 0.00355323 0.01740381 0.01196506
0.02635861 0.07487128 0.08472879 0.0073544 0.01150437 0.00571884
0.02025574 0.0014028 0.01512884 0.02146636 0.05097344 0.0284405
0.06151386 0.00737863 0.04452918 0.03906948 0.01163942 0.07468007
0.01647074 0.0096667 0.00369201 0.0168171 ]
</pre></div>
</div>
</div>
@@ -1776,15 +1788,15 @@ but now splitting the data into a training set and a test set.</p>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 2.05054319 -0.48521055 6.95338273 -2.63619709 1.0524497 ]
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 1.97802245 0.57331229 2.49761526 3.47609206 -1.5187643 ]
Training R2
0.9959308805732706
0.995702810640425
Training MSE
0.009211602191395454
0.007370297974992432
Test R2
0.9955318336036834
0.9950019477819025
Test MSE
0.011818646101922625
0.009880124918446542
</pre></div>
</div>
</div>
@@ -2448,9 +2460,7 @@ the aims is to reproduce Figure 2.11 of <a class="reference external" href="http
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>MSE before scaling: 0.00
R2 score before scaling 1.00
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Feature min values before scaling:
Feature min values before scaling:
[1.00000000e+00 6.97906022e-03 2.43639284e-03 4.87072815e-05
1.70037324e-05 5.93601008e-06 3.39931051e-07 1.18670072e-07
4.14277718e-08 1.44624525e-08 2.37239927e-09 8.28205578e-10