correcting typos

This commit is contained in:
Morten Hjorth-Jensen
2023-08-21 10:26:16 +02:00
parent cc9c5de45b
commit 7cceb6f7bd
7 changed files with 319 additions and 313 deletions
+3 -2
View File
@@ -503,7 +503,7 @@ that is the degree of a given polynomial.
<p>The aim is to reproduce Figure 2.11 of <a href="https://github.com/CompPhysics/MLErasmus/blob/master/doc/Textbooks/elementsstat.pdf" target="_self">Hastie et al</a>.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( 100 \) data points. You should try to vary \( n \) in your analysis.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( n=100 \) data points. You should try to vary the number of data points \( n \) in your analysis.</p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="cell border-box-sizing code_cell rendered">
@@ -544,7 +544,8 @@ Write a first code which sets up a design matrix \( X \) defined by a fifth-orde
<!-- --- begin subexercise --- -->
<p>
<b>b)</b>
Perform an ordinary least squares fitting and compute the means squared error for the training data and the test data.
Write thereafter (using either <b>scikit-learn</b> or your matrix inversion code using for example <b>numpy</b>)
and perform an ordinary least squares fitting and compute the mean squared error for the training data and the test data. These calculations should apply to a model given by a fifth-order polynomial.
</p>
<!-- --- end subexercise --- -->
+3 -2
View File
@@ -3966,7 +3966,7 @@ that is the degree of a given polynomial.
<p>The aim is to reproduce Figure 2.11 of <a href="https://github.com/CompPhysics/MLErasmus/blob/master/doc/Textbooks/elementsstat.pdf" target="_blank">Hastie et al</a>.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( 100 \) data points. You should try to vary \( n \) in your analysis.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( n=100 \) data points. You should try to vary the number of data points \( n \) in your analysis.</p>
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
<div class="cell border-box-sizing code_cell rendered">
@@ -4007,7 +4007,8 @@ Write a first code which sets up a design matrix \( X \) defined by a fifth-orde
<!-- --- begin subexercise --- -->
<p>
<b>b)</b>
Perform an ordinary least squares fitting and compute the means squared error for the training data and the test data.
Write thereafter (using either <b>scikit-learn</b> or your matrix inversion code using for example <b>numpy</b>)
and perform an ordinary least squares fitting and compute the mean squared error for the training data and the test data. These calculations should apply to a model given by a fifth-order polynomial.
</p>
<!-- --- end subexercise --- -->
+3 -2
View File
@@ -3831,7 +3831,7 @@ that is the degree of a given polynomial.
<p>The aim is to reproduce Figure 2.11 of <a href="https://github.com/CompPhysics/MLErasmus/blob/master/doc/Textbooks/elementsstat.pdf" target="_blank">Hastie et al</a>.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( 100 \) data points. You should try to vary \( n \) in your analysis.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( n=100 \) data points. You should try to vary the number of data points \( n \) in your analysis.</p>
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
<div class="cell border-box-sizing code_cell rendered">
@@ -3872,7 +3872,8 @@ Write a first code which sets up a design matrix \( X \) defined by a fifth-orde
<!-- --- begin subexercise --- -->
<p>
<b>b)</b>
Perform an ordinary least squares fitting and compute the means squared error for the training data and the test data.
Write thereafter (using either <b>scikit-learn</b> or your matrix inversion code using for example <b>numpy</b>)
and perform an ordinary least squares fitting and compute the mean squared error for the training data and the test data. These calculations should apply to a model given by a fifth-order polynomial.
</p>
<!-- --- end subexercise --- -->
+3 -2
View File
@@ -3908,7 +3908,7 @@ that is the degree of a given polynomial.
<p>The aim is to reproduce Figure 2.11 of <a href="https://github.com/CompPhysics/MLErasmus/blob/master/doc/Textbooks/elementsstat.pdf" target="_blank">Hastie et al</a>.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( 100 \) data points. You should try to vary \( n \) in your analysis.</p>
<p>Our data is defined by \( x\in [-3,3] \) with a total of for example \( n=100 \) data points. You should try to vary the number of data points \( n \) in your analysis.</p>
<!-- code=python (!bc pycod) typeset with pygments style "default" -->
<div class="cell border-box-sizing code_cell rendered">
@@ -3949,7 +3949,8 @@ Write a first code which sets up a design matrix \( X \) defined by a fifth-orde
<!-- --- begin subexercise --- -->
<p>
<b>b)</b>
Perform an ordinary least squares fitting and compute the means squared error for the training data and the test data.
Write thereafter (using either <b>scikit-learn</b> or your matrix inversion code using for example <b>numpy</b>)
and perform an ordinary least squares fitting and compute the mean squared error for the training data and the test data. These calculations should apply to a model given by a fifth-order polynomial.
</p>
<!-- --- end subexercise --- -->
Binary file not shown.
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -2584,7 +2584,7 @@ that is the degree of a given polynomial.
The aim is to reproduce Figure 2.11 of "Hastie et al":"https://github.com/CompPhysics/MLErasmus/blob/master/doc/Textbooks/elementsstat.pdf".
Our data is defined by $x\in [-3,3]$ with a total of for example $100$ data points. You should try to vary $n$ in your analysis.
Our data is defined by $x\in [-3,3]$ with a total of for example $n=100$ data points. You should try to vary the number of data points $n$ in your analysis.
!bc pycod
np.random.seed()
n = 100
@@ -2598,7 +2598,8 @@ Write a first code which sets up a design matrix $X$ defined by a fifth-order po
!esubex
!bsubex
Perform an ordinary least squares fitting and compute the means squared error for the training data and the test data.
Write thereafter (using either _scikit-learn_ or your matrix inversion code using for example _numpy_)
and perform an ordinary least squares fitting and compute the mean squared error for the training data and the test data. These calculations should apply to a model given by a fifth-order polynomial.
!esubex
!bsubex