updating book

This commit is contained in:
Morten Hjorth-Jensen
2023-09-18 12:44:58 +02:00
parent 409e8ba58e
commit 83ef9e4213
18 changed files with 866 additions and 856 deletions
+39 -29
View File
@@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Week 37: Statitsitcal interpretations and Resampling Methods &#8212; Applied Data Analysis and Machine Learning</title>
<title>Week 37: Statistical interpretations and Resampling Methods &#8212; Applied Data Analysis and Machine Learning</title>
<link href="_static/css/theme.css" rel="stylesheet">
<link href="_static/css/index.ff1ffe594081f20da1ef19478df9384b.css" rel="stylesheet">
@@ -55,7 +55,7 @@ const thebe_selector_output = ".output, .cell_output"
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Project 1 on Machine Learning, deadline October 9 (midnight), 2023" href="project1.html" />
<link rel="next" title="Exercises week 38" href="exercisesweek38.html" />
<link rel="prev" title="Exercises week 37" href="exercisesweek37.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="None">
@@ -285,7 +285,17 @@ const thebe_selector_output = ".output, .cell_output"
</li>
<li class="toctree-l1 current active">
<a class="current reference internal" href="#">
Week 37: Statitsitcal interpretations and Resampling Methods
Week 37: Statistical interpretations and Resampling Methods
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="exercisesweek38.html">
Exercises week 38
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="week38.html">
Week38: Logistic Regression and Optimization
</a>
</li>
</ul>
@@ -657,7 +667,7 @@ const thebe_selector_output = ".output, .cell_output"
<div class="col-12 col-md-9 pl-md-3 pr-md-0">
<!-- Table of contents that is only displayed when printing the page -->
<div id="jb-print-docs-body" class="onlyprint">
<h1>Week 37: Statitsitcal interpretations and Resampling Methods</h1>
<h1>Week 37: Statistical interpretations and Resampling Methods</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
@@ -954,10 +964,10 @@ const thebe_selector_output = ".output, .cell_output"
<!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/)
doconce format html week37.do.txt --no_mako -->
<!-- dom:TITLE: Week 37: Statitsitcal interpretations and Resampling Methods --><div class="tex2jax_ignore mathjax_ignore section" id="week-37-statitsitcal-interpretations-and-resampling-methods">
<h1>Week 37: Statitsitcal interpretations and Resampling Methods<a class="headerlink" href="#week-37-statitsitcal-interpretations-and-resampling-methods" title="Permalink to this headline"></a></h1>
<!-- dom:TITLE: Week 37: Statistical interpretations and Resampling Methods --><div class="tex2jax_ignore mathjax_ignore section" id="week-37-statistical-interpretations-and-resampling-methods">
<h1>Week 37: Statistical interpretations and Resampling Methods<a class="headerlink" href="#week-37-statistical-interpretations-and-resampling-methods" title="Permalink to this headline"></a></h1>
<p><strong>Morten Hjorth-Jensen</strong>, Department of Physics, University of Oslo and Department of Physics and Astronomy and Facility for Rare Isotope Beams, Michigan State University</p>
<p>Date: <strong>Sep 14, 2023</strong></p>
<p>Date: <strong>Sep 18, 2023</strong></p>
<p>Copyright 1999-2023, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license</p>
<!-- todo add link to videos and add link to Van Wieringens notes --><div class="section" id="plans-for-week-37">
<h2>Plans for week 37<a class="headerlink" href="#plans-for-week-37" title="Permalink to this headline"></a></h2>
@@ -1767,7 +1777,7 @@ theorem.</p>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Bootstrap Statistics :
original bias std. error
99.9713 14.943 99.972 0.149583
99.971 15.2789 99.9715 0.152907
</pre></div>
</div>
</div>
@@ -2002,14 +2012,14 @@ Error: 0.06844519414009445
Bias^2: 0.06453579006728322
Var: 0.003909404072811221
0.06844519414009445 &gt;= 0.06453579006728322 + 0.003909404072811221 = 0.06844519414009444
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 5
Polynomial degree: 5
Error: 0.05227921801205679
Bias^2: 0.04818727730430286
Var: 0.004091940707753925
0.05227921801205679 &gt;= 0.04818727730430286 + 0.004091940707753925 = 0.05227921801205679
Polynomial degree: 6
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 6
Error: 0.03781367141738902
Bias^2: 0.03365768507152769
Var: 0.0041559863458613296
@@ -2029,14 +2039,14 @@ Error: 0.026605727637184558
Bias^2: 0.010018312644139219
Var: 0.016587414993045335
0.026605727637184558 &gt;= 0.010018312644139219 + 0.016587414993045335 = 0.026605727637184554
Polynomial degree: 10
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 10
Error: 0.021592704588021178
Bias^2: 0.010516485576646504
Var: 0.01107621901137467
0.021592704588021178 &gt;= 0.010516485576646504 + 0.01107621901137467 = 0.021592704588021174
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Polynomial degree: 11
Polynomial degree: 11
Error: 0.07160048164232538
Bias^2: 0.014436800088896381
Var: 0.05716368155342902
@@ -2473,12 +2483,12 @@ Mean squared error on test data: 238.16356503
Degree of polynomial: 20
Mean squared error on training data: 0.00140849
Mean squared error on test data: 1345.68592431
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 21
Degree of polynomial: 21
Mean squared error on training data: 0.00119699
Mean squared error on test data: 1836.21110005
Degree of polynomial: 22
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 22
Mean squared error on training data: 0.00092904
Mean squared error on test data: 1182.64316482
Degree of polynomial: 23
@@ -2493,12 +2503,12 @@ Mean squared error on test data: 7697.35412147
Degree of polynomial: 26
Mean squared error on training data: 0.00075597
Mean squared error on test data: 1078.81597834
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 27
Degree of polynomial: 27
Mean squared error on training data: 0.00068088
Mean squared error on test data: 3189.20355156
Degree of polynomial: 28
</pre></div>
</div>
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Degree of polynomial: 28
Mean squared error on training data: 0.00063364
Mean squared error on test data: 692.24085321
Degree of polynomial: 29
@@ -2506,9 +2516,9 @@ Mean squared error on training data: 0.00063862
Mean squared error on test data: 3073.63180447
</pre></div>
</div>
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31560/626635268.py:73: RuntimeWarning: divide by zero encountered in log10
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10727/626635268.py:73: RuntimeWarning: divide by zero encountered in log10
plt.plot(polynomial, np.log10(trainingerror), label=&#39;Training Error&#39;)
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31560/626635268.py:74: RuntimeWarning: divide by zero encountered in log10
/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10727/626635268.py:74: RuntimeWarning: divide by zero encountered in log10
plt.plot(polynomial, np.log10(testerror), label=&#39;Test Error&#39;)
</pre></div>
</div>
@@ -2593,7 +2603,7 @@ Mean squared error on test data: 3073.63180447
</div>
</div>
<div class="cell_output docutils container">
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_31560/3817475779.py:63: RuntimeWarning: divide by zero encountered in log10
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_10727/3817475779.py:63: RuntimeWarning: divide by zero encountered in log10
plt.plot(polynomial, np.log10(estimated_mse_sklearn), label=&#39;Test Error&#39;)
</pre></div>
</div>
@@ -2990,10 +3000,10 @@ using the <strong>standardscaler</strong> functionality of the library
<p class="prev-next-title">Exercises week 37</p>
</div>
</a>
<a class='right-next' id="next-link" href="project1.html" title="next page">
<a class='right-next' id="next-link" href="exercisesweek38.html" title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">Project 1 on Machine Learning, deadline October 9 (midnight), 2023</p>
<p class="prev-next-title">Exercises week 38</p>
</div>
<i class="fas fa-angle-right"></i>
</a>