updating week 38
This commit is contained in:
@@ -422,6 +422,7 @@ MathJax.Hub.Config({
|
||||
|
||||
<ul>
|
||||
<li> Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression</li>
|
||||
<li> <a href="https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage" target="_self">Video of Lecture September 23</a></li>
|
||||
<li> Friday: Logistic Regression and Optimization methods</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -544,6 +544,9 @@ $$
|
||||
\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert.
|
||||
$$
|
||||
|
||||
<p>
|
||||
It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept.
|
||||
|
||||
<p>
|
||||
<p>
|
||||
<!-- navigation buttons at the bottom of the page -->
|
||||
|
||||
@@ -506,11 +506,15 @@ plt<span style="color: #666666">.</span>show()
|
||||
<p>
|
||||
We see here, when compared to the code which includes explicitely the
|
||||
intercept column, that our MSE value is actually smaller. This is
|
||||
because the regularization term does not include the intercept value \( \beta_0 \) in the
|
||||
fitting. This applies to Lasso regularization as well.
|
||||
because the regularization term does not include the intercept value
|
||||
\( \beta_0 \) in the fitting. This applies to Lasso regularization as
|
||||
well. It means that our optimization is now done only with the
|
||||
centered matrix and/or vector that enter the fitting procedure. Note
|
||||
also that the problem with the intercept occurs mainly in these type
|
||||
of polynomial fitting problem.
|
||||
|
||||
<p>
|
||||
If we stay with ordinary least squares, there is no dependence on the value of the intercept when we perform the fitting.
|
||||
The next example is indeed an example where all these discussions about the role of intercept are not present.
|
||||
|
||||
<p>
|
||||
<p>
|
||||
|
||||
@@ -163,6 +163,7 @@ MathJax.Hub.Config({
|
||||
|
||||
<ul>
|
||||
<p><li> Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression</li>
|
||||
<p><li> <a href="https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage" target="_blank">Video of Lecture September 23</a></li>
|
||||
<p><li> Friday: Logistic Regression and Optimization methods</li>
|
||||
</ul>
|
||||
</section>
|
||||
@@ -795,6 +796,9 @@ $$
|
||||
\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert.
|
||||
$$
|
||||
<p> <br>
|
||||
|
||||
<p>
|
||||
It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept.
|
||||
</section>
|
||||
|
||||
|
||||
@@ -970,11 +974,15 @@ plt.show()
|
||||
<p>
|
||||
We see here, when compared to the code which includes explicitely the
|
||||
intercept column, that our MSE value is actually smaller. This is
|
||||
because the regularization term does not include the intercept value \( \beta_0 \) in the
|
||||
fitting. This applies to Lasso regularization as well.
|
||||
because the regularization term does not include the intercept value
|
||||
\( \beta_0 \) in the fitting. This applies to Lasso regularization as
|
||||
well. It means that our optimization is now done only with the
|
||||
centered matrix and/or vector that enter the fitting procedure. Note
|
||||
also that the problem with the intercept occurs mainly in these type
|
||||
of polynomial fitting problem.
|
||||
|
||||
<p>
|
||||
If we stay with ordinary least squares, there is no dependence on the value of the intercept when we perform the fitting.
|
||||
The next example is indeed an example where all these discussions about the role of intercept are not present.
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
@@ -346,6 +346,7 @@ MathJax.Hub.Config({
|
||||
|
||||
<ul>
|
||||
<li> Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression</li>
|
||||
<li> <a href="https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage" target="_blank">Video of Lecture September 23</a></li>
|
||||
<li> Friday: Logistic Regression and Optimization methods</li>
|
||||
</ul>
|
||||
|
||||
@@ -924,6 +925,9 @@ $$
|
||||
\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert.
|
||||
$$
|
||||
|
||||
<p>
|
||||
It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept.
|
||||
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
@@ -1098,11 +1102,15 @@ plt.show()
|
||||
<p>
|
||||
We see here, when compared to the code which includes explicitely the
|
||||
intercept column, that our MSE value is actually smaller. This is
|
||||
because the regularization term does not include the intercept value \( \beta_0 \) in the
|
||||
fitting. This applies to Lasso regularization as well.
|
||||
because the regularization term does not include the intercept value
|
||||
\( \beta_0 \) in the fitting. This applies to Lasso regularization as
|
||||
well. It means that our optimization is now done only with the
|
||||
centered matrix and/or vector that enter the fitting procedure. Note
|
||||
also that the problem with the intercept occurs mainly in these type
|
||||
of polynomial fitting problem.
|
||||
|
||||
<p>
|
||||
If we stay with ordinary least squares, there is no dependence on the value of the intercept when we perform the fitting.
|
||||
The next example is indeed an example where all these discussions about the role of intercept are not present.
|
||||
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
@@ -351,6 +351,7 @@ MathJax.Hub.Config({
|
||||
|
||||
<ul>
|
||||
<li> Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression</li>
|
||||
<li> <a href="https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage" target="_blank">Video of Lecture September 23</a></li>
|
||||
<li> Friday: Logistic Regression and Optimization methods</li>
|
||||
</ul>
|
||||
|
||||
@@ -929,6 +930,9 @@ $$
|
||||
\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert.
|
||||
$$
|
||||
|
||||
<p>
|
||||
It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept.
|
||||
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
@@ -1103,11 +1107,15 @@ plt<span style="color: #666666">.</span>show()
|
||||
<p>
|
||||
We see here, when compared to the code which includes explicitely the
|
||||
intercept column, that our MSE value is actually smaller. This is
|
||||
because the regularization term does not include the intercept value \( \beta_0 \) in the
|
||||
fitting. This applies to Lasso regularization as well.
|
||||
because the regularization term does not include the intercept value
|
||||
\( \beta_0 \) in the fitting. This applies to Lasso regularization as
|
||||
well. It means that our optimization is now done only with the
|
||||
centered matrix and/or vector that enter the fitting procedure. Note
|
||||
also that the problem with the intercept occurs mainly in these type
|
||||
of polynomial fitting problem.
|
||||
|
||||
<p>
|
||||
If we stay with ordinary least squares, there is no dependence on the value of the intercept when we perform the fitting.
|
||||
The next example is indeed an example where all these discussions about the role of intercept are not present.
|
||||
|
||||
<p>
|
||||
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
Binary file not shown.
+206
-483
File diff suppressed because one or more lines are too long
@@ -10,6 +10,7 @@ DATE: today
|
||||
===== Plans for week 38 =====
|
||||
|
||||
* Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression
|
||||
* "Video of Lecture September 23":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage"
|
||||
* Friday: Logistic Regression and Optimization methods
|
||||
|
||||
|
||||
@@ -553,7 +554,7 @@ the way we treat the intercept may give a larger or smaller MSE,
|
||||
meaning that the MSE can be penalized by the value of the
|
||||
intercept. Not including the intercept in the fit, means that the
|
||||
regularization term does not include $\beta_0$. For different values
|
||||
of $\lambda$, this may lead to differeing MSE values.
|
||||
of $\lambda$, this may lead to differeing MSE values.
|
||||
|
||||
To remind the reader, the regularization term, with the intercept in Ridge regression is given by
|
||||
!bt
|
||||
@@ -575,6 +576,7 @@ For Lasso regression we have
|
||||
\]
|
||||
!et
|
||||
|
||||
It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept.
|
||||
|
||||
!split
|
||||
===== Code Examples =====
|
||||
@@ -743,10 +745,15 @@ plt.show()
|
||||
|
||||
We see here, when compared to the code which includes explicitely the
|
||||
intercept column, that our MSE value is actually smaller. This is
|
||||
because the regularization term does not include the intercept value $\beta_0$ in the
|
||||
fitting. This applies to Lasso regularization as well.
|
||||
because the regularization term does not include the intercept value
|
||||
$\beta_0$ in the fitting. This applies to Lasso regularization as
|
||||
well. It means that our optimization is now done only with the
|
||||
centered matrix and/or vector that enter the fitting procedure. Note
|
||||
also that the problem with the intercept occurs mainly in these type
|
||||
of polynomial fitting problem.
|
||||
|
||||
The next example is indeed an example where all these discussions about the role of intercept are not present.
|
||||
|
||||
If we stay with ordinary least squares, there is no dependence on the value of the intercept when we perform the fitting.
|
||||
|
||||
!split
|
||||
===== More complicated Example: The Ising model =====
|
||||
|
||||
Reference in New Issue
Block a user