update week 34 and typos
This commit is contained in:
@@ -2459,12 +2459,6 @@ Write a first code which sets up a design matrix \( X \) defined by a fifth-orde
|
||||
<b>b)</b>
|
||||
Perform an ordinary least squares and compute the means squared error and the \( R2 \) factor for the training data and the test data, with and without scaling.
|
||||
|
||||
<p>
|
||||
<!-- --- begin solution of exercise --- -->
|
||||
<b>Solution.</b>
|
||||
This requires a simple extension to the above code where you simply add a statement calling the \( R2 \) function included in the same code.
|
||||
<!-- --- end solution of exercise --- -->
|
||||
|
||||
<p>
|
||||
<b>c)</b>
|
||||
Add now a model which allows you to make polynomials up to degree \( 15 \). Perform a standard OLS fitting of the training data and compute the MSE and \( R2 \) for the training and test data and plot both test and training data MSE and \( R2 \) as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)?
|
||||
|
||||
@@ -2433,12 +2433,6 @@ Write a first code which sets up a design matrix \( X \) defined by a fifth-orde
|
||||
<b>b)</b>
|
||||
Perform an ordinary least squares and compute the means squared error and the \( R2 \) factor for the training data and the test data, with and without scaling.
|
||||
|
||||
<p>
|
||||
<!-- --- begin solution of exercise --- -->
|
||||
<b>Solution.</b>
|
||||
This requires a simple extension to the above code where you simply add a statement calling the \( R2 \) function included in the same code.
|
||||
<!-- --- end solution of exercise --- -->
|
||||
|
||||
<p>
|
||||
<b>c)</b>
|
||||
Add now a model which allows you to make polynomials up to degree \( 15 \). Perform a standard OLS fitting of the training data and compute the MSE and \( R2 \) for the training and test data and plot both test and training data MSE and \( R2 \) as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)?
|
||||
|
||||
@@ -2438,12 +2438,6 @@ Write a first code which sets up a design matrix \( X \) defined by a fifth-orde
|
||||
<b>b)</b>
|
||||
Perform an ordinary least squares and compute the means squared error and the \( R2 \) factor for the training data and the test data, with and without scaling.
|
||||
|
||||
<p>
|
||||
<!-- --- begin solution of exercise --- -->
|
||||
<b>Solution.</b>
|
||||
This requires a simple extension to the above code where you simply add a statement calling the \( R2 \) function included in the same code.
|
||||
<!-- --- end solution of exercise --- -->
|
||||
|
||||
<p>
|
||||
<b>c)</b>
|
||||
Add now a model which allows you to make polynomials up to degree \( 15 \). Perform a standard OLS fitting of the training data and compute the MSE and \( R2 \) for the training and test data and plot both test and training data MSE and \( R2 \) as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)?
|
||||
|
||||
Binary file not shown.
@@ -2818,12 +2818,6 @@
|
||||
"**b)**\n",
|
||||
"Perform an ordinary least squares and compute the means squared error and the $R2$ factor for the training data and the test data, with and without scaling.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"<!-- --- begin solution of exercise --- -->\n",
|
||||
"**Solution.**\n",
|
||||
"This requires a simple extension to the above code where you simply add a statement calling the $R2$ function included in the same code.\n",
|
||||
"<!-- --- end solution of exercise --- -->\n",
|
||||
"\n",
|
||||
"**c)**\n",
|
||||
"Add now a model which allows you to make polynomials up to degree $15$. Perform a standard OLS fitting of the training data and compute the MSE and $R2$ for the training and test data and plot both test and training data MSE and $R2$ as functions of the polynomial degree. Compare what you see with Figure 2.11 of Hastie et al. Comment your results. For which polynomial degree do you find an optimal MSE (smallest value)?\n",
|
||||
"\n",
|
||||
|
||||
@@ -1916,9 +1916,6 @@ Write a first code which sets up a design matrix $X$ defined by a fifth-order po
|
||||
|
||||
!bsubex
|
||||
Perform an ordinary least squares and compute the means squared error and the $R2$ factor for the training data and the test data, with and without scaling.
|
||||
!bsol
|
||||
This requires a simple extension to the above code where you simply add a statement calling the $R2$ function included in the same code.
|
||||
!esol
|
||||
!esubex
|
||||
|
||||
!bsubex
|
||||
|
||||
Reference in New Issue
Block a user