This commit is contained in:
Morten Hjorth-Jensen
2024-11-25 08:12:27 +01:00
parent d63cb194d5
commit c8f2aa3dc1
181 changed files with 13447 additions and 2592 deletions
+30 -25
View File
@@ -257,6 +257,9 @@
<li class="toctree-l1"><a class="reference internal" href="week47.html">Week 47: From Decision Trees to Ensemble Methods, Random Forests and Boosting Methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek47.html">Exercise week 47</a></li>
<li class="toctree-l1"><a class="reference internal" href="week48.html">Week 48: Gradient boosting and summary of course</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek48.html">Exercises week 48</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Projects</span></p>
<ul class="nav bd-sidenav">
@@ -1021,7 +1024,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.9952260624201319
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.9954482269282812
</pre></div>
</div>
</div>
@@ -1038,7 +1041,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.01138349118139106
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.008936538168866639
</pre></div>
</div>
</div>
@@ -1053,23 +1056,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>[0.03126071 0.00179226 0.05225439 0.00372999 0.02734884 0.05333172
0.02020016 0.01521008 0.00965948 0.0056274 0.01055702 0.01870768
0.07847027 0.00766418 0.00385358 0.01374419 0.04181664 0.00933893
0.00312107 0.01294475 0.07413571 0.11552511 0.01637903 0.02176175
0.00854766 0.04706879 0.05041282 0.00575302 0.02289663 0.01263793
0.03325052 0.01806972 0.0066441 0.05997838 0.02861775 0.04882654
0.08480358 0.03542954 0.01143948 0.00619982 0.00278866 0.00995497
0.02001832 0.03635157 0.00732822 0.01114894 0.07709391 0.01125655
0.00816671 0.01114243 0.00550993 0.06590956 0.04805237 0.04394445
0.00825943 0.00935925 0.023291 0.05290093 0.01249864 0.02700809
0.00271844 0.01806574 0.01238543 0.03213764 0.02680834 0.02269712
0.02734783 0.00461485 0.0352873 0.01616311 0.00968169 0.02333957
0.00912667 0.03871805 0.01637128 0.02097868 0.00230726 0.08493636
0.05203452 0.0498517 0.01619572 0.02339214 0.03510055 0.04566385
0.0024319 0.02956756 0.05981231 0.00394204 0.02607172 0.02627472
0.02413198 0.00518272 0.02283931 0.01528494 0.01208287 0.02055319
0.01180608 0.01603956 0.02803521 0.07787677]
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[0.04030775 0.05734435 0.01740914 0.02044029 0.02486199 0.03573222
0.00752453 0.0573522 0.00102185 0.04459142 0.03221764 0.00342095
0.01898739 0.03160225 0.00450564 0.01979508 0.00152143 0.00857666
0.00762566 0.00703236 0.00490815 0.02171406 0.04265231 0.03063862
0.0273619 0.00668013 0.03013331 0.00788426 0.01275493 0.01698978
0.02715714 0.0164838 0.00424614 0.06575617 0.03937194 0.0459393
0.03321665 0.00857944 0.01458459 0.03839052 0.04106931 0.01962178
0.01758251 0.06598382 0.01262347 0.05373197 0.00508233 0.02902908
0.01284702 0.02266783 0.05481819 0.02857842 0.00817663 0.00478164
0.02844986 0.03430817 0.00845377 0.01544721 0.00867529 0.01881047
0.02900428 0.00525951 0.00516358 0.05597496 0.03021621 0.00458845
0.0134627 0.00244413 0.00194759 0.04527404 0.02602746 0.00545794
0.00747748 0.01109822 0.08180185 0.02539315 0.02321685 0.02859203
0.01136476 0.00341608 0.00341404 0.00651846 0.05339963 0.01042549
0.02637872 0.00639212 0.02177328 0.02384275 0.00133169 0.00699813
0.0205469 0.04806452 0.01573671 0.05430636 0.01207681 0.0160536
0.01157049 0.08333949 0.01405686 0.00212278]
</pre></div>
</div>
</div>
@@ -1138,15 +1141,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.06741397 -0.19826431 5.13801381 0.12625265 -0.15070691]
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[ 2.04491327 -0.39593882 6.26462211 -1.4899045 0.59718501]
Training R2
0.9959102280411898
0.9973808396916977
Training MSE
0.007840268112476161
0.005799563292953798
Test R2
0.9923171995387728
0.9950846163116835
Test MSE
0.016855069963547485
0.011719944818178452
</pre></div>
</div>
</div>
@@ -2095,7 +2098,9 @@ MSE with intercept column
0.00411363461744314
MSE with intercept column from SKL
0.004113634617443147
Manual intercept: 2.083766322923899
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Manual intercept: 2.083766322923899
Fitted beta (wiothout intercept): [0.19569961 3.97898392]
Sklearn intercept: 2.0837663229239043
Sklearn fitted beta (without intercept): [0.19569961 3.97898392]