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
+14 -11
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">
@@ -730,7 +733,7 @@ Thereafter we wish to apply it to data which were not included in the training.
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/7208bf883e220945a23bf4a64d7c474c22032a9479d0230f3f7627fde6c870e3.png" src="_images/7208bf883e220945a23bf4a64d7c474c22032a9479d0230f3f7627fde6c870e3.png" />
<img alt="_images/01d44d8b3777894a56df96cdebd9411c2a9b9484e40698be0bb84652c7d0f7cf.png" src="_images/01d44d8b3777894a56df96cdebd9411c2a9b9484e40698be0bb84652c7d0f7cf.png" />
</div>
</div>
<p>This example serves several aims. It allows us to demonstrate several
@@ -815,7 +818,7 @@ to be dominated by outliers.</p>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/daf635918e102d6af1572d0f6fcb2bcd9c93425cd41e91dc85022a813e3b1da5.png" src="_images/daf635918e102d6af1572d0f6fcb2bcd9c93425cd41e91dc85022a813e3b1da5.png" />
<img alt="_images/326bc2bdd25593d0947bbe11be557f7c976fd425b872153c8c8317ebbb51c5ae.png" src="_images/326bc2bdd25593d0947bbe11be557f7c976fd425b872153c8c8317ebbb51c5ae.png" />
</div>
</div>
<p>Depending on the parameter in front of the normal distribution, we may
@@ -862,16 +865,16 @@ example of the functionality of <strong>Scikit-Learn</strong>.</p>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>The intercept alpha:
[1.97386121]
[2.00949975]
Coefficient beta :
[[5.12574106]]
Mean squared error: 0.20
Variance score: 0.92
Mean squared log error: 0.01
Mean absolute error: 0.36
[[5.07244691]]
Mean squared error: 0.30
Variance score: 0.88
Mean squared log error: 0.02
Mean absolute error: 0.42
</pre></div>
</div>
<img alt="_images/1168b639886622ca16f51897f200d03b2de325bfc3f6688b4b75ff4473160f59.png" src="_images/1168b639886622ca16f51897f200d03b2de325bfc3f6688b4b75ff4473160f59.png" />
<img alt="_images/b39b8ed8a4aed5f4a94d2137c267e12d64d23f66d1c50c3e3ad1ae8cd8b9ff5e.png" src="_images/b39b8ed8a4aed5f4a94d2137c267e12d64d23f66d1c50c3e3ad1ae8cd8b9ff5e.png" />
</div>
</div>
<p>The function <strong>coef</strong> gives us the parameter <span class="math notranslate nohighlight">\(\beta\)</span> of our fit while <strong>intercept</strong> yields
@@ -967,8 +970,8 @@ a linear <span class="math notranslate nohighlight">\(x\)</span>-dependence we s
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/2e42f972e6bd064ce2062209501a6f469d0ebd090cf62a0159f888f2deaa3de7.png" src="_images/2e42f972e6bd064ce2062209501a6f469d0ebd090cf62a0159f888f2deaa3de7.png" />
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.004999999999999993
<img alt="_images/99bd4e87bbb54a5fb018ef916c872e3158711414d535c467a50d947ace53c954.png" src="_images/99bd4e87bbb54a5fb018ef916c872e3158711414d535c467a50d947ace53c954.png" />
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>0.005000000000000009
</pre></div>
</div>
</div>