diff --git a/doc/pub/week36/html/._week36-bs000.html b/doc/pub/week36/html/._week36-bs000.html index f57c90ea1..58940ff0b 100644 --- a/doc/pub/week36/html/._week36-bs000.html +++ b/doc/pub/week36/html/._week36-bs000.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -381,7 +376,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs001.html b/doc/pub/week36/html/._week36-bs001.html index ab9ca0866..cca919e64 100644 --- a/doc/pub/week36/html/._week36-bs001.html +++ b/doc/pub/week36/html/._week36-bs001.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -378,7 +373,7 @@ MathJax.Hub.Config({
  • 10
  • 11
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs002.html b/doc/pub/week36/html/._week36-bs002.html index c564cd8e5..6562ccb1b 100644 --- a/doc/pub/week36/html/._week36-bs002.html +++ b/doc/pub/week36/html/._week36-bs002.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -360,7 +355,7 @@ MathJax.Hub.Config({
  • 11
  • 12
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs003.html b/doc/pub/week36/html/._week36-bs003.html index c781a6c26..b325aa64c 100644 --- a/doc/pub/week36/html/._week36-bs003.html +++ b/doc/pub/week36/html/._week36-bs003.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -391,7 +386,7 @@ We can then interpret our optimal model \( \tilde{\boldsymbol{y}} \) as being re
  • 12
  • 13
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs004.html b/doc/pub/week36/html/._week36-bs004.html index c619f4e4b..2300e3f96 100644 --- a/doc/pub/week36/html/._week36-bs004.html +++ b/doc/pub/week36/html/._week36-bs004.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -369,7 +364,7 @@ $$
  • 13
  • 14
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs005.html b/doc/pub/week36/html/._week36-bs005.html index 0838e61ab..c7f8a2e1b 100644 --- a/doc/pub/week36/html/._week36-bs005.html +++ b/doc/pub/week36/html/._week36-bs005.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -381,7 +376,7 @@ $$
  • 14
  • 15
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs006.html b/doc/pub/week36/html/._week36-bs006.html index 3bdf15db5..d5aee7d0d 100644 --- a/doc/pub/week36/html/._week36-bs006.html +++ b/doc/pub/week36/html/._week36-bs006.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -406,7 +401,7 @@ reduced to the statistically relevant features.
  • 15
  • 16
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs007.html b/doc/pub/week36/html/._week36-bs007.html index e380808b8..6debe3df1 100644 --- a/doc/pub/week36/html/._week36-bs007.html +++ b/doc/pub/week36/html/._week36-bs007.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -412,7 +407,7 @@ This is equivalent to saying that the matrix \( \boldsymbol{X} \) has at least a
  • 16
  • 17
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs008.html b/doc/pub/week36/html/._week36-bs008.html index e0216cae4..6454c123a 100644 --- a/doc/pub/week36/html/._week36-bs008.html +++ b/doc/pub/week36/html/._week36-bs008.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -353,7 +348,7 @@ $$

    has linearly dependent column vectors, we will not be able to compute the inverse of \( \boldsymbol{X}^T\boldsymbol{X} \) and we cannot find the parameters (estimators) \( \theta_i \). -The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exits. +The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exists. This is more likely to happen when the matrix \( \boldsymbol{X} \) is high-dimensional. In this case it is likely to encounter a situation where the regression parameters \( \theta_i \) cannot be estimated.

    @@ -388,7 +383,7 @@ $$
  • 17
  • 18
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs009.html b/doc/pub/week36/html/._week36-bs009.html index d5097caa1..27b511aab 100644 --- a/doc/pub/week36/html/._week36-bs009.html +++ b/doc/pub/week36/html/._week36-bs009.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -419,7 +414,7 @@ $$
  • 18
  • 19
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs010.html b/doc/pub/week36/html/._week36-bs010.html index f0dab0766..77d060b51 100644 --- a/doc/pub/week36/html/._week36-bs010.html +++ b/doc/pub/week36/html/._week36-bs010.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -512,7 +507,7 @@ What happens if we do not include the intercept in our fit? We will discuss this
  • 19
  • 20
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs011.html b/doc/pub/week36/html/._week36-bs011.html index 7f80790b9..2c4c9689d 100644 --- a/doc/pub/week36/html/._week36-bs011.html +++ b/doc/pub/week36/html/._week36-bs011.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -402,7 +397,7 @@ $$
  • 20
  • 21
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs012.html b/doc/pub/week36/html/._week36-bs012.html index 31bb02542..3037683ac 100644 --- a/doc/pub/week36/html/._week36-bs012.html +++ b/doc/pub/week36/html/._week36-bs012.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -413,7 +408,7 @@ near singular or singular matrices.
  • 21
  • 22
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs013.html b/doc/pub/week36/html/._week36-bs013.html index 2e1f9eee8..ee6502939 100644 --- a/doc/pub/week36/html/._week36-bs013.html +++ b/doc/pub/week36/html/._week36-bs013.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -388,7 +383,7 @@ In general the economy-size SVD leads to less FLOPS and still conserving the des
  • 22
  • 23
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs014.html b/doc/pub/week36/html/._week36-bs014.html index 0fd476cda..04c6c8b9b 100644 --- a/doc/pub/week36/html/._week36-bs014.html +++ b/doc/pub/week36/html/._week36-bs014.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -429,7 +424,7 @@ in the program terminating due to a singular matrix.
  • 23
  • 24
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs015.html b/doc/pub/week36/html/._week36-bs015.html index ece3ea8cb..87bc11009 100644 --- a/doc/pub/week36/html/._week36-bs015.html +++ b/doc/pub/week36/html/._week36-bs015.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -384,7 +379,7 @@ example
  • 24
  • 25
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs016.html b/doc/pub/week36/html/._week36-bs016.html index 89db92c07..543854a57 100644 --- a/doc/pub/week36/html/._week36-bs016.html +++ b/doc/pub/week36/html/._week36-bs016.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -399,7 +394,7 @@ $$
  • 25
  • 26
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs017.html b/doc/pub/week36/html/._week36-bs017.html index b7b195327..a2b684c2d 100644 --- a/doc/pub/week36/html/._week36-bs017.html +++ b/doc/pub/week36/html/._week36-bs017.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -423,7 +418,7 @@ decomposition of the design matrix.
  • 26
  • 27
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs018.html b/doc/pub/week36/html/._week36-bs018.html index 4e29dd83f..925d393d1 100644 --- a/doc/pub/week36/html/._week36-bs018.html +++ b/doc/pub/week36/html/._week36-bs018.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -410,7 +405,7 @@ orthogonality relation for the matrix \( \boldsymbol{U} \).
  • 27
  • 28
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs019.html b/doc/pub/week36/html/._week36-bs019.html index bc0db0a6e..6cf373b27 100644 --- a/doc/pub/week36/html/._week36-bs019.html +++ b/doc/pub/week36/html/._week36-bs019.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -414,7 +409,7 @@ for the definition of for example the covariance matrix and its relation to the
  • 28
  • 29
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs020.html b/doc/pub/week36/html/._week36-bs020.html index e5c3d3739..df6812055 100644 --- a/doc/pub/week36/html/._week36-bs020.html +++ b/doc/pub/week36/html/._week36-bs020.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -441,7 +436,7 @@ $$
  • 29
  • 30
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs021.html b/doc/pub/week36/html/._week36-bs021.html index a8cdf99a2..56d0a235f 100644 --- a/doc/pub/week36/html/._week36-bs021.html +++ b/doc/pub/week36/html/._week36-bs021.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -383,7 +378,7 @@ eigenvalues ordered in a descending way, that is \( \sigma_i \geq
  • 30
  • 31
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs022.html b/doc/pub/week36/html/._week36-bs022.html index d54b0a138..e55c85abe 100644 --- a/doc/pub/week36/html/._week36-bs022.html +++ b/doc/pub/week36/html/._week36-bs022.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -396,7 +391,7 @@ Similarly, Mehta et al
  • 31
  • 32
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs023.html b/doc/pub/week36/html/._week36-bs023.html index 8f4ae2d68..226bacf2e 100644 --- a/doc/pub/week36/html/._week36-bs023.html +++ b/doc/pub/week36/html/._week36-bs023.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -362,12 +357,12 @@ $$

    and reordering we have

    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

    We can redefine \( \lambda \) to absorb the constant \( n/2 \) and we rewrite the last equation as

    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

    This equation does not lead to a nice analytical equation as in either Ridge regression or ordinary least squares. This equation can however be solved by using standard convex optimization algorithms.We will discuss how to code the above methods using gradient descent methods.

    @@ -397,7 +392,7 @@ $$
  • 32
  • 33
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs024.html b/doc/pub/week36/html/._week36-bs024.html index 29652a194..04d8f47b1 100644 --- a/doc/pub/week36/html/._week36-bs024.html +++ b/doc/pub/week36/html/._week36-bs024.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -378,7 +373,7 @@ some approximative/numerical method to compute the minimum.
  • 33
  • 34
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs025.html b/doc/pub/week36/html/._week36-bs025.html index cb4529754..4f3882ce4 100644 --- a/doc/pub/week36/html/._week36-bs025.html +++ b/doc/pub/week36/html/._week36-bs025.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -379,7 +374,7 @@ normally discourage the use of this method.
  • 34
  • 35
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs026.html b/doc/pub/week36/html/._week36-bs026.html index 745b54ff9..af68129bc 100644 --- a/doc/pub/week36/html/._week36-bs026.html +++ b/doc/pub/week36/html/._week36-bs026.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -399,7 +394,7 @@ $$
  • 35
  • 36
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs027.html b/doc/pub/week36/html/._week36-bs027.html index 581fd1d9d..0079a605c 100644 --- a/doc/pub/week36/html/._week36-bs027.html +++ b/doc/pub/week36/html/._week36-bs027.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -381,7 +376,7 @@ vanishes, then Newton-Raphson may fail totally
  • 36
  • 37
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs028.html b/doc/pub/week36/html/._week36-bs028.html index 938787074..f0d55be95 100644 --- a/doc/pub/week36/html/._week36-bs028.html +++ b/doc/pub/week36/html/._week36-bs028.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -419,7 +414,7 @@ more than two non-linear equations. In our case, the Jacobian matrix is given by
  • 37
  • 38
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs029.html b/doc/pub/week36/html/._week36-bs029.html index 0b834bbab..4df722bdc 100644 --- a/doc/pub/week36/html/._week36-bs029.html +++ b/doc/pub/week36/html/._week36-bs029.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -386,7 +381,7 @@ we are always moving towards smaller function values, i.e a minimum.
  • 38
  • 39
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs030.html b/doc/pub/week36/html/._week36-bs030.html index 3d033a921..fd11030c4 100644 --- a/doc/pub/week36/html/._week36-bs030.html +++ b/doc/pub/week36/html/._week36-bs030.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -382,7 +377,7 @@ the learning rate within the context of Machine Learning.
  • 39
  • 40
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs031.html b/doc/pub/week36/html/._week36-bs031.html index 80a4db8d1..2302b8c29 100644 --- a/doc/pub/week36/html/._week36-bs031.html +++ b/doc/pub/week36/html/._week36-bs031.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -389,7 +384,7 @@ sensitive to the chosen initial condition.
  • 40
  • 41
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs032.html b/doc/pub/week36/html/._week36-bs032.html index f10ae0b98..10cdff9c1 100644 --- a/doc/pub/week36/html/._week36-bs032.html +++ b/doc/pub/week36/html/._week36-bs032.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -382,7 +377,7 @@ randomness. One such method is that of Stochastic Gradient Descent
  • 41
  • 42
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs033.html b/doc/pub/week36/html/._week36-bs033.html index 35564e080..4693acdcd 100644 --- a/doc/pub/week36/html/._week36-bs033.html +++ b/doc/pub/week36/html/._week36-bs033.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -382,7 +377,7 @@ regular polygons (triangles, rectangles, pentagons, etc...).
  • 42
  • 43
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs034.html b/doc/pub/week36/html/._week36-bs034.html index 45569807a..a602dedcc 100644 --- a/doc/pub/week36/html/._week36-bs034.html +++ b/doc/pub/week36/html/._week36-bs034.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -370,7 +365,7 @@ MathJax.Hub.Config({
  • 43
  • 44
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs035.html b/doc/pub/week36/html/._week36-bs035.html index 404b85f2d..c1dff9599 100644 --- a/doc/pub/week36/html/._week36-bs035.html +++ b/doc/pub/week36/html/._week36-bs035.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -406,7 +401,7 @@ everywhere.
  • 44
  • 45
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs036.html b/doc/pub/week36/html/._week36-bs036.html index 69dc86416..9a7741e00 100644 --- a/doc/pub/week36/html/._week36-bs036.html +++ b/doc/pub/week36/html/._week36-bs036.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -393,7 +388,7 @@ is minimal, where \( f \) is convex and differentiable. Then, any point
  • 45
  • 46
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs037.html b/doc/pub/week36/html/._week36-bs037.html index 577b7ac6f..ef725472d 100644 --- a/doc/pub/week36/html/._week36-bs037.html +++ b/doc/pub/week36/html/._week36-bs037.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -385,7 +380,7 @@ MathJax.Hub.Config({
  • 46
  • 47
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs038.html b/doc/pub/week36/html/._week36-bs038.html index e71e88410..c78e80c98 100644 --- a/doc/pub/week36/html/._week36-bs038.html +++ b/doc/pub/week36/html/._week36-bs038.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -418,7 +413,7 @@ $$
  • 47
  • 48
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs039.html b/doc/pub/week36/html/._week36-bs039.html index 409c7b43a..5d0007019 100644 --- a/doc/pub/week36/html/._week36-bs039.html +++ b/doc/pub/week36/html/._week36-bs039.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -386,7 +381,7 @@ $$
  • 48
  • 49
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs040.html b/doc/pub/week36/html/._week36-bs040.html index dac9934dd..2e94bcb69 100644 --- a/doc/pub/week36/html/._week36-bs040.html +++ b/doc/pub/week36/html/._week36-bs040.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -377,7 +372,7 @@ $$
  • 49
  • 50
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs041.html b/doc/pub/week36/html/._week36-bs041.html index 94662a5e1..d1ccae0c4 100644 --- a/doc/pub/week36/html/._week36-bs041.html +++ b/doc/pub/week36/html/._week36-bs041.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -377,7 +372,7 @@ $$
  • 50
  • 51
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs042.html b/doc/pub/week36/html/._week36-bs042.html index 1626912e4..9193625eb 100644 --- a/doc/pub/week36/html/._week36-bs042.html +++ b/doc/pub/week36/html/._week36-bs042.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -382,7 +377,7 @@ when \( ||\nabla_\theta C(\theta_k) || \leq \epsilon = 10^{-8} \). Note that
  • 51
  • 52
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs043.html b/doc/pub/week36/html/._week36-bs043.html index 0689ce40d..42f529cdd 100644 --- a/doc/pub/week36/html/._week36-bs043.html +++ b/doc/pub/week36/html/._week36-bs043.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -437,7 +432,7 @@ plt.show()
  • 52
  • 53
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs044.html b/doc/pub/week36/html/._week36-bs044.html index 495dc6232..2ca0f9a07 100644 --- a/doc/pub/week36/html/._week36-bs044.html +++ b/doc/pub/week36/html/._week36-bs044.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -340,46 +335,25 @@ MathJax.Hub.Config({

     

     

     

    - -

    And a corresponding example using scikit-learn

    + +

    Gradient descent and Ridge

    +

    We have also discussed Ridge regression where the loss function contains a regularized term given by the \( L_2 \) norm of \( \theta \),

    +$$ +C_{\text{ridge}}(\theta) = \frac{1}{n}||X\theta -\mathbf{y}||^2 + \lambda ||\theta||^2, \ \lambda \geq 0. +$$ - -
    -
    -
    -
    -
    -
    # Importing various packages
    -from random import random, seed
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn.linear_model import SGDRegressor
    +

    In order to minimize \( C_{\text{ridge}}(\theta) \) using GD we adjust the gradient as follows

    +$$ +\nabla_\theta C_{\text{ridge}}(\theta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\theta_0+\theta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\theta_0+\theta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} + 2\lambda\begin{bmatrix} \theta_0 \\ \theta_1\end{bmatrix} = 2 (\frac{1}{n}X^T(X\theta - \mathbf{y})+\lambda \theta). +$$ -n = 100 -x = 2*np.random.rand(n,1) -y = 4+3*x+np.random.randn(n,1) - -X = np.c_[np.ones((n,1)), x] -theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y) -print(theta_linreg) -sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1) -sgdreg.fit(x,y.ravel()) -print(sgdreg.intercept_, sgdreg.coef_) -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +

    We can easily extend our program to minimize \( C_{\text{ridge}}(\theta) \) using gradient descent and compare with the analytical solution given by

    +$$ +\theta_{\text{ridge}} = \left(X^T X + n\lambda I_{2 \times 2} \right)^{-1} X^T \mathbf{y}. +$$

    @@ -407,7 +381,7 @@ sgdreg.fit(x,y.

  • 53
  • 54
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs045.html b/doc/pub/week36/html/._week36-bs045.html index d21d7fd1a..01f49a808 100644 --- a/doc/pub/week36/html/._week36-bs045.html +++ b/doc/pub/week36/html/._week36-bs045.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -340,26 +335,22 @@ MathJax.Hub.Config({

     

     

     

    - -

    Gradient descent and Ridge

    - -

    We have also discussed Ridge regression where the loss function contains a regularized term given by the \( L_2 \) norm of \( \theta \),

    + +

    The Hessian matrix for Ridge Regression

    +

    The Hessian matrix of Ridge Regression for our simple example is given by

    $$ -C_{\text{ridge}}(\theta) = \frac{1}{n}||X\theta -\mathbf{y}||^2 + \lambda ||\theta||^2, \ \lambda \geq 0. -$$ - -

    In order to minimize \( C_{\text{ridge}}(\theta) \) using GD we adjust the gradient as follows

    -$$ -\nabla_\theta C_{\text{ridge}}(\theta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\theta_0+\theta_1x_i-y_i\right) \\ -\sum_{i=1}^{100}\left( x_i (\theta_0+\theta_1x_i)-y_ix_i\right) \\ -\end{bmatrix} + 2\lambda\begin{bmatrix} \theta_0 \\ \theta_1\end{bmatrix} = 2 (\frac{1}{n}X^T(X\theta - \mathbf{y})+\lambda \theta). -$$ - -

    We can easily extend our program to minimize \( C_{\text{ridge}}(\theta) \) using gradient descent and compare with the analytical solution given by

    -$$ -\theta_{\text{ridge}} = \left(X^T X + n\lambda I_{2 \times 2} \right)^{-1} X^T \mathbf{y}. +\boldsymbol{H} \equiv \begin{bmatrix} +\frac{\partial^2 C(\theta)}{\partial \theta_0^2} & \frac{\partial^2 C(\theta)}{\partial \theta_0 \partial \theta_1} \\ +\frac{\partial^2 C(\theta)}{\partial \theta_0 \partial \theta_1} & \frac{\partial^2 C(\theta)}{\partial \theta_1^2} & \\ +\end{bmatrix} = \frac{2}{n}X^T X+2\lambda\boldsymbol{I}. $$ +

    This implies that the Hessian matrix is positive definite, hence the stationary point is a +minimum. +Note that the Ridge cost function is convex being a sum of two convex +functions. Therefore, the stationary point is a global +minimum of this function. +

    @@ -386,7 +377,7 @@ $$

  • 54
  • 55
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs046.html b/doc/pub/week36/html/._week36-bs046.html index 01a6a2ba8..f304fe8fc 100644 --- a/doc/pub/week36/html/._week36-bs046.html +++ b/doc/pub/week36/html/._week36-bs046.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,21 +336,79 @@ MathJax.Hub.Config({

     

     

     

    -

    The Hessian matrix for Ridge Regression

    -

    The Hessian matrix of Ridge Regression for our simple example is given by

    -$$ -\boldsymbol{H} \equiv \begin{bmatrix} -\frac{\partial^2 C(\theta)}{\partial \theta_0^2} & \frac{\partial^2 C(\theta)}{\partial \theta_0 \partial \theta_1} \\ -\frac{\partial^2 C(\theta)}{\partial \theta_0 \partial \theta_1} & \frac{\partial^2 C(\theta)}{\partial \theta_1^2} & \\ -\end{bmatrix} = \frac{2}{n}X^T X+2\lambda\boldsymbol{I}. -$$ +

    Program example for gradient descent with Ridge Regression

    + + +
    +
    +
    +
    +
    +
    from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +XT_X = X.T @ X
    +
    +#Ridge parameter lambda
    +lmbda  = 0.001
    +Id = n*lmbda* np.eye(XT_X.shape[0])
    +
    +# Hessian matrix
    +H = (2.0/n)* XT_X+2*lmbda* np.eye(XT_X.shape[0])
    +# Get the eigenvalues
    +EigValues, EigVectors = np.linalg.eig(H)
    +print(f"Eigenvalues of Hessian Matrix:{EigValues}")
    +
    +
    +theta_linreg = np.linalg.inv(XT_X+Id) @ X.T @ y
    +print(theta_linreg)
    +# Start plain gradient descent
    +theta = np.random.randn(2,1)
    +
    +eta = 1.0/np.max(EigValues)
    +Niterations = 100
    +
    +for iter in range(Niterations):
    +    gradients = 2.0/n*X.T @ (X @ (theta)-y)+2*lmbda*theta
    +    theta -= eta*gradients
    +
    +print(theta)
    +ypredict = X @ theta
    +ypredict2 = X @ theta_linreg
    +plt.plot(x, ypredict, "r-")
    +plt.plot(x, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example for Ridge')
    +plt.show()
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    -

    This implies that the Hessian matrix is positive definite, hence the stationary point is a -minimum. -Note that the Ridge cost function is convex being a sum of two convex -functions. Therefore, the stationary point is a global -minimum of this function. -

    @@ -382,7 +435,7 @@ minimum of this function.

  • 55
  • 56
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs047.html b/doc/pub/week36/html/._week36-bs047.html index 6c14ad45b..aab0aada0 100644 --- a/doc/pub/week36/html/._week36-bs047.html +++ b/doc/pub/week36/html/._week36-bs047.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,80 +336,16 @@ MathJax.Hub.Config({

     

     

     

    -

    Program example for gradient descent with Ridge Regression

    - - -
    -
    -
    -
    -
    -
    from random import random, seed
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from mpl_toolkits.mplot3d import Axes3D
    -from matplotlib import cm
    -from matplotlib.ticker import LinearLocator, FormatStrFormatter
    -import sys
    -
    -# the number of datapoints
    -n = 100
    -x = 2*np.random.rand(n,1)
    -y = 4+3*x+np.random.randn(n,1)
    -
    -X = np.c_[np.ones((n,1)), x]
    -XT_X = X.T @ X
    -
    -#Ridge parameter lambda
    -lmbda  = 0.001
    -Id = n*lmbda* np.eye(XT_X.shape[0])
    -
    -# Hessian matrix
    -H = (2.0/n)* XT_X+2*lmbda* np.eye(XT_X.shape[0])
    -# Get the eigenvalues
    -EigValues, EigVectors = np.linalg.eig(H)
    -print(f"Eigenvalues of Hessian Matrix:{EigValues}")
    -
    -
    -theta_linreg = np.linalg.inv(XT_X+Id) @ X.T @ y
    -print(theta_linreg)
    -# Start plain gradient descent
    -theta = np.random.randn(2,1)
    -
    -eta = 1.0/np.max(EigValues)
    -Niterations = 100
    -
    -for iter in range(Niterations):
    -    gradients = 2.0/n*X.T @ (X @ (theta)-y)+2*lmbda*theta
    -    theta -= eta*gradients
    -
    -print(theta)
    -ypredict = X @ theta
    -ypredict2 = X @ theta_linreg
    -plt.plot(x, ypredict, "r-")
    -plt.plot(x, ypredict2, "b-")
    -plt.plot(x, y ,'ro')
    -plt.axis([0,2.0,0, 15.0])
    -plt.xlabel(r'$x$')
    -plt.ylabel(r'$y$')
    -plt.title(r'Gradient descent example for Ridge')
    -plt.show()
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - +

    Using gradient descent methods, limitations

    +
      +
    • Gradient descent (GD) finds local minima of our function. Since the GD algorithm is deterministic, if it converges, it will converge to a local minimum of our cost/loss/risk function. Because in ML we are often dealing with extremely rugged landscapes with many local minima, this can lead to poor performance.
    • +
    • GD is sensitive to initial conditions. One consequence of the local nature of GD is that initial conditions matter. Depending on where one starts, one will end up at a different local minima. Therefore, it is very important to think about how one initializes the training process. This is true for GD as well as more complicated variants of GD.
    • +
    • Gradients are computationally expensive to calculate for large datasets. In many cases in statistics and ML, the cost/loss/risk function is a sum of terms, with one term for each data point. For example, in linear regression, \( E \propto \sum_{i=1}^n (y_i - \mathbf{w}^T\cdot\mathbf{x}_i)^2 \); for logistic regression, the square error is replaced by the cross entropy. To calculate the gradient we have to sum over all \( n \) data points. Doing this at every GD step becomes extremely computationally expensive. An ingenious solution to this, is to calculate the gradients using small subsets of the data called "mini batches". This has the added benefit of introducing stochasticity into our algorithm.
    • +
    • GD is very sensitive to choices of learning rates. GD is extremely sensitive to the choice of learning rates. If the learning rate is very small, the training process take an extremely long time. For larger learning rates, GD can diverge and give poor results. Furthermore, depending on what the local landscape looks like, we have to modify the learning rates to ensure convergence. Ideally, we would adaptively choose the learning rates to match the landscape.
    • +
    • GD treats all directions in parameter space uniformly. Another major drawback of GD is that unlike Newton's method, the learning rate for GD is the same in all directions in parameter space. For this reason, the maximum learning rate is set by the behavior of the steepest direction and this can significantly slow down training. Ideally, we would like to take large steps in flat directions and small steps in steep directions. Since we are exploring rugged landscapes where curvatures change, this requires us to keep track of not only the gradient but second derivatives. The ideal scenario would be to calculate the Hessian but this proves to be too computationally expensive.
    • +
    • GD can take exponential time to escape saddle points, even with random initialization. As we mentioned, GD is extremely sensitive to initial condition since it determines the particular local minimum GD would eventually reach. However, even with a good initialization scheme, through the introduction of randomness, GD can still take exponential time to escape saddle points.
    • +

    diff --git a/doc/pub/week36/html/._week36-bs048.html b/doc/pub/week36/html/._week36-bs048.html index 386992f5f..261209a52 100644 --- a/doc/pub/week36/html/._week36-bs048.html +++ b/doc/pub/week36/html/._week36-bs048.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,16 +336,10 @@ MathJax.Hub.Config({

     

     

     

    -

    Using gradient descent methods, limitations

    +

    Material for lab sessions sessions Tuesday and Wednesday

    + +

    The material here contains a summary of the lecture on Monday and discussion of SVD, Ridge and Lasso regression with examples

    -
      -
    • Gradient descent (GD) finds local minima of our function. Since the GD algorithm is deterministic, if it converges, it will converge to a local minimum of our cost/loss/risk function. Because in ML we are often dealing with extremely rugged landscapes with many local minima, this can lead to poor performance.
    • -
    • GD is sensitive to initial conditions. One consequence of the local nature of GD is that initial conditions matter. Depending on where one starts, one will end up at a different local minima. Therefore, it is very important to think about how one initializes the training process. This is true for GD as well as more complicated variants of GD.
    • -
    • Gradients are computationally expensive to calculate for large datasets. In many cases in statistics and ML, the cost/loss/risk function is a sum of terms, with one term for each data point. For example, in linear regression, \( E \propto \sum_{i=1}^n (y_i - \mathbf{w}^T\cdot\mathbf{x}_i)^2 \); for logistic regression, the square error is replaced by the cross entropy. To calculate the gradient we have to sum over all \( n \) data points. Doing this at every GD step becomes extremely computationally expensive. An ingenious solution to this, is to calculate the gradients using small subsets of the data called "mini batches". This has the added benefit of introducing stochasticity into our algorithm.
    • -
    • GD is very sensitive to choices of learning rates. GD is extremely sensitive to the choice of learning rates. If the learning rate is very small, the training process take an extremely long time. For larger learning rates, GD can diverge and give poor results. Furthermore, depending on what the local landscape looks like, we have to modify the learning rates to ensure convergence. Ideally, we would adaptively choose the learning rates to match the landscape.
    • -
    • GD treats all directions in parameter space uniformly. Another major drawback of GD is that unlike Newton's method, the learning rate for GD is the same in all directions in parameter space. For this reason, the maximum learning rate is set by the behavior of the steepest direction and this can significantly slow down training. Ideally, we would like to take large steps in flat directions and small steps in steep directions. Since we are exploring rugged landscapes where curvatures change, this requires us to keep track of not only the gradient but second derivatives. The ideal scenario would be to calculate the Hessian but this proves to be too computationally expensive.
    • -
    • GD can take exponential time to escape saddle points, even with random initialization. As we mentioned, GD is extremely sensitive to initial condition since it determines the particular local minimum GD would eventually reach. However, even with a good initialization scheme, through the introduction of randomness, GD can still take exponential time to escape saddle points.
    • -

      @@ -376,7 +365,7 @@ MathJax.Hub.Config({
    • 57
    • 58
    • ...
    • -
    • 73
    • +
    • 72
    • »
    diff --git a/doc/pub/week36/html/._week36-bs049.html b/doc/pub/week36/html/._week36-bs049.html index 99fd6075c..69236fb90 100644 --- a/doc/pub/week36/html/._week36-bs049.html +++ b/doc/pub/week36/html/._week36-bs049.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,9 +336,39 @@ MathJax.Hub.Config({

     

     

     

    -

    Material for lab sessions sessions Tuesday and Wednesday

    +

    Linear Regression and the SVD

    + +

    We used the SVD to analyse the matrix to invert in ordinary lineat regression

    +$$ +\boldsymbol{X}^T\boldsymbol{X}=\boldsymbol{V}\boldsymbol{\Sigma}^T\boldsymbol{U}^T\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T=\boldsymbol{V}\boldsymbol{\Sigma}^T\boldsymbol{\Sigma}\boldsymbol{V}^T. +$$ + +

    Since the matrices here have dimension \( p\times p \), with \( p \) corresponding to the singular values, we defined last week the matrix

    +$$ +\boldsymbol{\Sigma}^T\boldsymbol{\Sigma} = \begin{bmatrix} \tilde{\boldsymbol{\Sigma}} & \boldsymbol{0}\\ \end{bmatrix}\begin{bmatrix} \tilde{\boldsymbol{\Sigma}} \\ \boldsymbol{0}\end{bmatrix}, +$$ + +

    where the tilde-matrix \( \tilde{\boldsymbol{\Sigma}} \) is a matrix of dimension \( p\times p \) containing only the singular values \( \sigma_i \), that is

    + +$$ +\tilde{\boldsymbol{\Sigma}}=\begin{bmatrix} \sigma_0 & 0 & 0 & \dots & 0 & 0 \\ + 0 & \sigma_1 & 0 & \dots & 0 & 0 \\ + 0 & 0 & \sigma_2 & \dots & 0 & 0 \\ + 0 & 0 & 0 & \dots & \sigma_{p-2} & 0 \\ + 0 & 0 & 0 & \dots & 0 & \sigma_{p-1} \\ +\end{bmatrix}, +$$ + +

    meaning we can write

    +$$ +\boldsymbol{X}^T\boldsymbol{X}=\boldsymbol{V}\tilde{\boldsymbol{\Sigma}}^2\boldsymbol{V}^T. +$$ + +

    Multiplying from the right with \( \boldsymbol{V} \) (using the orthogonality of \( \boldsymbol{V} \)) we get

    +$$ +\left(\boldsymbol{X}^T\boldsymbol{X}\right)\boldsymbol{V}=\boldsymbol{V}\tilde{\boldsymbol{\Sigma}}^2. +$$ -

    The material here contains a summary of the lecture on Monday and discussion of SVD, Ridge and Lasso regression with examples

    @@ -370,7 +395,7 @@ MathJax.Hub.Config({

  • 58
  • 59
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs050.html b/doc/pub/week36/html/._week36-bs050.html index acc6038e8..aadcf8262 100644 --- a/doc/pub/week36/html/._week36-bs050.html +++ b/doc/pub/week36/html/._week36-bs050.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,39 +336,29 @@ MathJax.Hub.Config({

     

     

     

    -

    Linear Regression and the SVD

    +

    What does it mean?

    -

    We used the SVD to analyse the matrix to invert in ordinary lineat regression

    -$$ -\boldsymbol{X}^T\boldsymbol{X}=\boldsymbol{V}\boldsymbol{\Sigma}^T\boldsymbol{U}^T\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T=\boldsymbol{V}\boldsymbol{\Sigma}^T\boldsymbol{\Sigma}\boldsymbol{V}^T. -$$ - -

    Since the matrices here have dimension \( p\times p \), with \( p \) corresponding to the singular values, we defined last week the matrix

    -$$ -\boldsymbol{\Sigma}^T\boldsymbol{\Sigma} = \begin{bmatrix} \tilde{\boldsymbol{\Sigma}} & \boldsymbol{0}\\ \end{bmatrix}\begin{bmatrix} \tilde{\boldsymbol{\Sigma}} \\ \boldsymbol{0}\end{bmatrix}, -$$ - -

    where the tilde-matrix \( \tilde{\boldsymbol{\Sigma}} \) is a matrix of dimension \( p\times p \) containing only the singular values \( \sigma_i \), that is

    +

    This means the vectors \( \boldsymbol{v}_i \) of the orthogonal matrix \( \boldsymbol{V} \) +are the eigenvectors of the matrix \( \boldsymbol{X}^T\boldsymbol{X} \) with eigenvalues +given by the singular values squared, that is +

    $$ -\tilde{\boldsymbol{\Sigma}}=\begin{bmatrix} \sigma_0 & 0 & 0 & \dots & 0 & 0 \\ - 0 & \sigma_1 & 0 & \dots & 0 & 0 \\ - 0 & 0 & \sigma_2 & \dots & 0 & 0 \\ - 0 & 0 & 0 & \dots & \sigma_{p-2} & 0 \\ - 0 & 0 & 0 & \dots & 0 & \sigma_{p-1} \\ -\end{bmatrix}, +\left(\boldsymbol{X}^T\boldsymbol{X}\right)\boldsymbol{v}_i=\boldsymbol{v}_i\sigma_i^2. $$ -

    meaning we can write

    -$$ -\boldsymbol{X}^T\boldsymbol{X}=\boldsymbol{V}\tilde{\boldsymbol{\Sigma}}^2\boldsymbol{V}^T. -$$ - -

    Multiplying from the right with \( \boldsymbol{V} \) (using the orthogonality of \( \boldsymbol{V} \)) we get

    -$$ -\left(\boldsymbol{X}^T\boldsymbol{X}\right)\boldsymbol{V}=\boldsymbol{V}\tilde{\boldsymbol{\Sigma}}^2. -$$ +

    In other words, each non-zero singular value of \( \boldsymbol{X} \) is a positive +square root of an eigenvalue of \( \boldsymbol{X}^T\boldsymbol{X} \). It means also that +the columns of \( \boldsymbol{V} \) are the eigenvectors of +\( \boldsymbol{X}^T\boldsymbol{X} \). Since we have ordered the singular values of +\( \boldsymbol{X} \) in a descending order, it means that the column vectors +\( \boldsymbol{v}_i \) are hierarchically ordered by how much correlation they +encode from the columns of \( \boldsymbol{X} \). +

    +

    Note that these are also the eigenvectors and eigenvalues of the +Hessian matrix. +

    @@ -400,7 +385,7 @@ $$

  • 59
  • 60
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs051.html b/doc/pub/week36/html/._week36-bs051.html index 46759c5eb..566dd5549 100644 --- a/doc/pub/week36/html/._week36-bs051.html +++ b/doc/pub/week36/html/._week36-bs051.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,29 +336,26 @@ MathJax.Hub.Config({

     

     

     

    -

    What does it mean?

    +

    Ridge and LASSO Regression

    -

    This means the vectors \( \boldsymbol{v}_i \) of the orthogonal matrix \( \boldsymbol{V} \) -are the eigenvectors of the matrix \( \boldsymbol{X}^T\boldsymbol{X} \) with eigenvalues -given by the singular values squared, that is +

    Let us remind ourselves about the expression for the standard Mean Squared Error (MSE) which we used to define our cost function and the equations for the ordinary least squares (OLS) method, that is +our optimization problem is

    - $$ -\left(\boldsymbol{X}^T\boldsymbol{X}\right)\boldsymbol{v}_i=\boldsymbol{v}_i\sigma_i^2. +{\displaystyle \min_{\boldsymbol{\theta}\in {\mathbb{R}}^{p}}}\frac{1}{n}\left\{\left(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\right)^T\left(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\right)\right\}. $$ -

    In other words, each non-zero singular value of \( \boldsymbol{X} \) is a positive -square root of an eigenvalue of \( \boldsymbol{X}^T\boldsymbol{X} \). It means also that -the columns of \( \boldsymbol{V} \) are the eigenvectors of -\( \boldsymbol{X}^T\boldsymbol{X} \). Since we have ordered the singular values of -\( \boldsymbol{X} \) in a descending order, it means that the column vectors -\( \boldsymbol{v}_i \) are hierarchically ordered by how much correlation they -encode from the columns of \( \boldsymbol{X} \). -

    +

    or we can state it as

    +$$ +{\displaystyle \min_{\boldsymbol{\theta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\sum_{i=0}^{n-1}\left(y_i-\tilde{y}_i\right)^2=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2, +$$ + +

    where we have used the definition of a norm-2 vector, that is

    +$$ +\vert\vert \boldsymbol{x}\vert\vert_2 = \sqrt{\sum_i x_i^2}. +$$ -

    Note that these are also the eigenvectors and eigenvalues of the -Hessian matrix. -

    @@ -390,7 +382,7 @@ Hessian matrix.

  • 60
  • 61
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs052.html b/doc/pub/week36/html/._week36-bs052.html index 8b9f7a759..1f7f567d1 100644 --- a/doc/pub/week36/html/._week36-bs052.html +++ b/doc/pub/week36/html/._week36-bs052.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,24 +336,41 @@ MathJax.Hub.Config({

     

     

     

    -

    Ridge and LASSO Regression

    +

    From OLS to Ridge and Lasso

    -

    Let us remind ourselves about the expression for the standard Mean Squared Error (MSE) which we used to define our cost function and the equations for the ordinary least squares (OLS) method, that is -our optimization problem is +

    By minimizing the above equation with respect to the parameters +\( \boldsymbol{\theta} \) we could then obtain an analytical expression for the +parameters \( \boldsymbol{\theta} \). We can add a regularization parameter \( \lambda \) by +defining a new cost function to be optimized, that is

    -$$ -{\displaystyle \min_{\boldsymbol{\theta}\in {\mathbb{R}}^{p}}}\frac{1}{n}\left\{\left(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\right)^T\left(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\right)\right\}. -$$ -

    or we can state it as

    $$ {\displaystyle \min_{\boldsymbol{\theta}\in -{\mathbb{R}}^{p}}}\frac{1}{n}\sum_{i=0}^{n-1}\left(y_i-\tilde{y}_i\right)^2=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2, +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\theta}\vert\vert_2^2 $$ -

    where we have used the definition of a norm-2 vector, that is

    +

    which leads to the Ridge regression minimization problem where we +require that \( \vert\vert \boldsymbol{\theta}\vert\vert_2^2\le t \), where \( t \) is +a finite number larger than zero. We do not include such a constraints in the discussions here. +

    + +

    By defining

    + $$ -\vert\vert \boldsymbol{x}\vert\vert_2 = \sqrt{\sum_i x_i^2}. +C(\boldsymbol{X},\boldsymbol{\theta})=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\theta}\vert\vert_1, +$$ + +

    we have a new optimization equation

    +$$ +{\displaystyle \min_{\boldsymbol{\theta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\theta}\vert\vert_1 +$$ + +

    which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator.

    + +

    Here we have defined the norm-1 as

    +$$ +\vert\vert \boldsymbol{x}\vert\vert_1 = \sum_i \vert x_i\vert. $$ @@ -387,7 +399,7 @@ $$
  • 61
  • 62
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs053.html b/doc/pub/week36/html/._week36-bs053.html index fd61dc475..652e6eccd 100644 --- a/doc/pub/week36/html/._week36-bs053.html +++ b/doc/pub/week36/html/._week36-bs053.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,43 +336,31 @@ MathJax.Hub.Config({

     

     

     

    -

    From OLS to Ridge and Lasso

    +

    Deriving the Ridge Regression Equations

    -

    By minimizing the above equation with respect to the parameters -\( \boldsymbol{\theta} \) we could then obtain an analytical expression for the -parameters \( \boldsymbol{\theta} \). We can add a regularization parameter \( \lambda \) by -defining a new cost function to be optimized, that is +

    Using the matrix-vector expression for Ridge regression and dropping the parameter \( 1/n \) in front of the standard means squared error equation, we have

    + +$$ +C(\boldsymbol{X},\boldsymbol{\theta})=\left\{(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})^T(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})\right\}+\lambda\boldsymbol{\theta}^T\boldsymbol{\theta}, +$$ + +

    and +taking the derivatives with respect to \( \boldsymbol{\theta} \) we obtain then +a slightly modified matrix inversion problem which for finite values +of \( \lambda \) does not suffer from singularity problems. We obtain +the optimal parameters

    - $$ -{\displaystyle \min_{\boldsymbol{\theta}\in -{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\theta}\vert\vert_2^2 +\hat{\boldsymbol{\theta}}_{\mathrm{Ridge}} = \left(\boldsymbol{X}^T\boldsymbol{X}+\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}, $$ -

    which leads to the Ridge regression minimization problem where we -require that \( \vert\vert \boldsymbol{\theta}\vert\vert_2^2\le t \), where \( t \) is -a finite number larger than zero. We do not include such a constraints in the discussions here. -

    - -

    By defining

    +

    with \( \boldsymbol{I} \) being a \( p\times p \) identity matrix with the constraint that

    $$ -C(\boldsymbol{X},\boldsymbol{\theta})=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\theta}\vert\vert_1, -$$ - -

    we have a new optimization equation

    -$$ -{\displaystyle \min_{\boldsymbol{\theta}\in -{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\theta}\vert\vert_1 -$$ - -

    which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator.

    - -

    Here we have defined the norm-1 as

    -$$ -\vert\vert \boldsymbol{x}\vert\vert_1 = \sum_i \vert x_i\vert. +\sum_{i=0}^{p-1} \theta_i^2 \leq t, $$ +

    with \( t \) a finite positive number.

    @@ -404,7 +387,7 @@ $$

  • 62
  • 63
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs054.html b/doc/pub/week36/html/._week36-bs054.html index 78806ccd5..17be9b46a 100644 --- a/doc/pub/week36/html/._week36-bs054.html +++ b/doc/pub/week36/html/._week36-bs054.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,31 +336,15 @@ MathJax.Hub.Config({

     

     

     

    -

    Deriving the Ridge Regression Equations

    +

    Note on Scikit-Learn

    -

    Using the matrix-vector expression for Ridge regression and dropping the parameter \( 1/n \) in front of the standard means squared error equation, we have

    +

    Note well that a library like Scikit-Learn does not include the \( 1/n \) factor in the expression for the mean-squared error. If you include it, the optimal parameter \( \theta \) becomes

    $$ -C(\boldsymbol{X},\boldsymbol{\theta})=\left\{(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})^T(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})\right\}+\lambda\boldsymbol{\theta}^T\boldsymbol{\theta}, +\hat{\boldsymbol{\theta}}_{\mathrm{Ridge}} = \left(\boldsymbol{X}^T\boldsymbol{X}+n\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}. $$ -

    and -taking the derivatives with respect to \( \boldsymbol{\theta} \) we obtain then -a slightly modified matrix inversion problem which for finite values -of \( \lambda \) does not suffer from singularity problems. We obtain -the optimal parameters -

    -$$ -\hat{\boldsymbol{\theta}}_{\mathrm{Ridge}} = \left(\boldsymbol{X}^T\boldsymbol{X}+\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}, -$$ - -

    with \( \boldsymbol{I} \) being a \( p\times p \) identity matrix with the constraint that

    - -$$ -\sum_{i=0}^{p-1} \theta_i^2 \leq t, -$$ - -

    with \( t \) a finite positive number.

    +

    In our codes where we compare our own codes with Scikit-Learn, we do thus not include the \( 1/n \) factor in the cost function.

    @@ -392,7 +371,7 @@ $$

  • 63
  • 64
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs055.html b/doc/pub/week36/html/._week36-bs055.html index a6829bd69..a4c6c9bf4 100644 --- a/doc/pub/week36/html/._week36-bs055.html +++ b/doc/pub/week36/html/._week36-bs055.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,15 +336,20 @@ MathJax.Hub.Config({

     

     

     

    -

    Note on Scikit-Learn

    - -

    Note well that a library like Scikit-Learn does not include the \( 1/n \) factor in the expression for the mean-squared error. If you include it, the optimal parameter \( \theta \) becomes

    - +

    Comparison with OLS

    +

    When we compare this with the ordinary least squares result we have

    $$ -\hat{\boldsymbol{\theta}}_{\mathrm{Ridge}} = \left(\boldsymbol{X}^T\boldsymbol{X}+n\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}. +\hat{\boldsymbol{\theta}}_{\mathrm{OLS}} = \left(\boldsymbol{X}^T\boldsymbol{X}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}, $$ -

    In our codes where we compare our own codes with Scikit-Learn, we do thus not include the \( 1/n \) factor in the cost function.

    +

    which can lead to singular matrices. However, with the SVD, we can always compute the inverse of the matrix \( \boldsymbol{X}^T\boldsymbol{X} \).

    + +

    We see that Ridge regression is nothing but the standard OLS with a +modified diagonal term added to \( \boldsymbol{X}^T\boldsymbol{X} \). The consequences, in +particular for our discussion of the bias-variance tradeoff are rather +interesting. We will see that for specific values of \( \lambda \), we may +even reduce the variance of the optimal parameters \( \boldsymbol{\theta} \). These topics and other related ones, will be discussed after the more linear algebra oriented analysis here. +

    @@ -376,7 +376,7 @@ $$

  • 64
  • 65
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs056.html b/doc/pub/week36/html/._week36-bs056.html index f4c7f9e12..6ec717ce0 100644 --- a/doc/pub/week36/html/._week36-bs056.html +++ b/doc/pub/week36/html/._week36-bs056.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,20 +336,22 @@ MathJax.Hub.Config({

     

     

     

    -

    Comparison with OLS

    -

    When we compare this with the ordinary least squares result we have

    -$$ -\hat{\boldsymbol{\theta}}_{\mathrm{OLS}} = \left(\boldsymbol{X}^T\boldsymbol{X}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}, -$$ +

    SVD analysis

    -

    which can lead to singular matrices. However, with the SVD, we can always compute the inverse of the matrix \( \boldsymbol{X}^T\boldsymbol{X} \).

    - -

    We see that Ridge regression is nothing but the standard OLS with a -modified diagonal term added to \( \boldsymbol{X}^T\boldsymbol{X} \). The consequences, in -particular for our discussion of the bias-variance tradeoff are rather -interesting. We will see that for specific values of \( \lambda \), we may -even reduce the variance of the optimal parameters \( \boldsymbol{\theta} \). These topics and other related ones, will be discussed after the more linear algebra oriented analysis here. +

    Using our insights about the SVD of the design matrix \( \boldsymbol{X} \) +We have already analyzed the OLS solutions in terms of the eigenvectors (the columns) of the right singular value matrix \( \boldsymbol{U} \) as

    +$$ +\tilde{\boldsymbol{y}}_{\mathrm{OLS}}=\boldsymbol{X}\boldsymbol{\theta} =\boldsymbol{U}\boldsymbol{U}^T\boldsymbol{y}. +$$ + +

    For Ridge regression this becomes

    + +$$ +\tilde{\boldsymbol{y}}_{\mathrm{Ridge}}=\boldsymbol{X}\boldsymbol{\theta}_{\mathrm{Ridge}} = \boldsymbol{U\Sigma V^T}\left(\boldsymbol{V}\boldsymbol{\Sigma}^2\boldsymbol{V}^T+\lambda\boldsymbol{I} \right)^{-1}(\boldsymbol{U\Sigma V^T})^T\boldsymbol{y}=\sum_{j=0}^{p-1}\boldsymbol{u}_j\boldsymbol{u}_j^T\frac{\sigma_j^2}{\sigma_j^2+\lambda}\boldsymbol{y}, +$$ + +

    with the vectors \( \boldsymbol{u}_j \) being the columns of \( \boldsymbol{U} \) from the SVD of the matrix \( \boldsymbol{X} \).

    @@ -381,7 +378,7 @@ even reduce the variance of the optimal parameters \( \boldsymbol{\theta} \). Th

  • 65
  • 66
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs057.html b/doc/pub/week36/html/._week36-bs057.html index b47e7d3f7..559f4222a 100644 --- a/doc/pub/week36/html/._week36-bs057.html +++ b/doc/pub/week36/html/._week36-bs057.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,22 +336,22 @@ MathJax.Hub.Config({

     

     

     

    -

    SVD analysis

    +

    Interpreting the Ridge results

    -

    Using our insights about the SVD of the design matrix \( \boldsymbol{X} \) -We have already analyzed the OLS solutions in terms of the eigenvectors (the columns) of the right singular value matrix \( \boldsymbol{U} \) as +

    Since \( \lambda \geq 0 \), it means that compared to OLS, we have

    + +$$ +\frac{\sigma_j^2}{\sigma_j^2+\lambda} \leq 1. +$$ + +

    Ridge regression finds the coordinates of \( \boldsymbol{y} \) with respect to the +orthonormal basis \( \boldsymbol{U} \), it then shrinks the coordinates by +\( \frac{\sigma_j^2}{\sigma_j^2+\lambda} \). Recall that the SVD has +eigenvalues ordered in a descending way, that is \( \sigma_i \geq +\sigma_{i+1} \).

    -$$ -\tilde{\boldsymbol{y}}_{\mathrm{OLS}}=\boldsymbol{X}\boldsymbol{\theta} =\boldsymbol{U}\boldsymbol{U}^T\boldsymbol{y}. -$$ -

    For Ridge regression this becomes

    - -$$ -\tilde{\boldsymbol{y}}_{\mathrm{Ridge}}=\boldsymbol{X}\boldsymbol{\theta}_{\mathrm{Ridge}} = \boldsymbol{U\Sigma V^T}\left(\boldsymbol{V}\boldsymbol{\Sigma}^2\boldsymbol{V}^T+\lambda\boldsymbol{I} \right)^{-1}(\boldsymbol{U\Sigma V^T})^T\boldsymbol{y}=\sum_{j=0}^{p-1}\boldsymbol{u}_j\boldsymbol{u}_j^T\frac{\sigma_j^2}{\sigma_j^2+\lambda}\boldsymbol{y}, -$$ - -

    with the vectors \( \boldsymbol{u}_j \) being the columns of \( \boldsymbol{U} \) from the SVD of the matrix \( \boldsymbol{X} \).

    +

    For small eigenvalues \( \sigma_i \) it means that their contributions become less important, a fact which can be used to reduce the number of degrees of freedom.

    @@ -383,7 +378,7 @@ $$

  • 66
  • 67
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs058.html b/doc/pub/week36/html/._week36-bs058.html index 36865f85d..1d996625b 100644 --- a/doc/pub/week36/html/._week36-bs058.html +++ b/doc/pub/week36/html/._week36-bs058.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,22 +336,35 @@ MathJax.Hub.Config({

     

     

     

    -

    Interpreting the Ridge results

    +

    More interpretations

    -

    Since \( \lambda \geq 0 \), it means that compared to OLS, we have

    +

    For the sake of simplicity, let us assume that the design matrix is orthonormal, that is

    $$ -\frac{\sigma_j^2}{\sigma_j^2+\lambda} \leq 1. +\boldsymbol{X}^T\boldsymbol{X}=(\boldsymbol{X}^T\boldsymbol{X})^{-1} =\boldsymbol{I}. $$ -

    Ridge regression finds the coordinates of \( \boldsymbol{y} \) with respect to the -orthonormal basis \( \boldsymbol{U} \), it then shrinks the coordinates by -\( \frac{\sigma_j^2}{\sigma_j^2+\lambda} \). Recall that the SVD has -eigenvalues ordered in a descending way, that is \( \sigma_i \geq -\sigma_{i+1} \). +

    In this case the standard OLS results in

    +$$ +\boldsymbol{\theta}^{\mathrm{OLS}} = \boldsymbol{X}^T\boldsymbol{y}=\sum_{i=0}^{n-1}\boldsymbol{u}_i\boldsymbol{u}_i^T\boldsymbol{y}, +$$ + +

    and

    + +$$ +\boldsymbol{\theta}^{\mathrm{Ridge}} = \left(\boldsymbol{I}+\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}=\left(1+\lambda\right)^{-1}\boldsymbol{\theta}^{\mathrm{OLS}}, +$$ + +

    that is the Ridge estimator scales the OLS estimator by the inverse of a factor \( 1+\lambda \), and +the Ridge estimator converges to zero when the hyperparameter goes to +infinity.

    -

    For small eigenvalues \( \sigma_i \) it means that their contributions become less important, a fact which can be used to reduce the number of degrees of freedom.

    +

    We will come back to more interpreations after we have gone through some of the statistical analysis part.

    + +

    For more discussions of Ridge and Lasso regression, Wessel van Wieringen's article is highly recommended. +Similarly, Mehta et al's article is also recommended. +

    @@ -383,7 +391,7 @@ eigenvalues ordered in a descending way, that is \( \sigma_i \geq

  • 67
  • 68
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs059.html b/doc/pub/week36/html/._week36-bs059.html index eaa1a7b4a..66499178c 100644 --- a/doc/pub/week36/html/._week36-bs059.html +++ b/doc/pub/week36/html/._week36-bs059.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,35 +336,31 @@ MathJax.Hub.Config({

     

     

     

    -

    More interpretations

    +

    Deriving the Lasso Regression Equations

    -

    For the sake of simplicity, let us assume that the design matrix is orthonormal, that is

    +

    Using the matrix-vector expression for Lasso regression, we have the following cost function

    $$ -\boldsymbol{X}^T\boldsymbol{X}=(\boldsymbol{X}^T\boldsymbol{X})^{-1} =\boldsymbol{I}. +C(\boldsymbol{X},\boldsymbol{\theta})=\frac{1}{n}\left\{(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})^T(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})\right\}+\lambda\vert\vert\boldsymbol{\theta}\vert\vert_1, $$ -

    In this case the standard OLS results in

    +

    Taking the derivative with respect to \( \boldsymbol{\theta} \) and recalling that the derivative of the absolute value is (we drop the boldfaced vector symbol for simplicity)

    $$ -\boldsymbol{\theta}^{\mathrm{OLS}} = \boldsymbol{X}^T\boldsymbol{y}=\sum_{i=0}^{n-1}\boldsymbol{u}_i\boldsymbol{u}_i^T\boldsymbol{y}, +\frac{d \vert \theta\vert}{d \theta}=\mathrm{sgn}(\theta)=\left\{\begin{array}{cc} 1 & \theta > 0 \\-1 & \theta < 0, \end{array}\right. $$ -

    and

    +

    we have that the derivative of the cost function is

    $$ -\boldsymbol{\theta}^{\mathrm{Ridge}} = \left(\boldsymbol{I}+\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}=\left(1+\lambda\right)^{-1}\boldsymbol{\theta}^{\mathrm{OLS}}, +\frac{\partial C(\boldsymbol{X},\boldsymbol{\theta})}{\partial \boldsymbol{\theta}}=-\frac{2}{n}\boldsymbol{X}^T(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})+\lambda sgn(\boldsymbol{\theta})=0, $$ -

    that is the Ridge estimator scales the OLS estimator by the inverse of a factor \( 1+\lambda \), and -the Ridge estimator converges to zero when the hyperparameter goes to -infinity. -

    +

    and reordering we have

    +$$ +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. +$$ -

    We will come back to more interpreations after we have gone through some of the statistical analysis part.

    - -

    For more discussions of Ridge and Lasso regression, Wessel van Wieringen's article is highly recommended. -Similarly, Mehta et al's article is also recommended. -

    +

    This equation does not lead to a nice analytical equation as in Ridge regression or ordinary least squares. We have absorbed the factor \( 2/n \) in a redefinition of the parameter \( \lambda \). We will solve this type of problems using libraries like scikit-learn and using our own gradient descent code in project 1.

    @@ -396,7 +387,7 @@ Similarly, Mehta et al

  • 68
  • 69
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs060.html b/doc/pub/week36/html/._week36-bs060.html index c7165173b..47e349556 100644 --- a/doc/pub/week36/html/._week36-bs060.html +++ b/doc/pub/week36/html/._week36-bs060.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,31 +336,22 @@ MathJax.Hub.Config({

     

     

     

    -

    Deriving the Lasso Regression Equations

    +

    Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression

    -

    Using the matrix-vector expression for Lasso regression, we have the following cost function

    +

    Let us assume that our design matrix is given by unit (identity) matrix, that is a square diagonal matrix with ones only along the +diagonal. In this case we have an equal number of rows and columns \( n=p \). +

    +

    Our model approximation is just \( \tilde{\boldsymbol{y}}=\boldsymbol{\theta} \) and the mean squared error and thereby the cost function for ordinary least sqquares (OLS) is then (we drop the term \( 1/n \))

    $$ -C(\boldsymbol{X},\boldsymbol{\theta})=\frac{1}{n}\left\{(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})^T(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})\right\}+\lambda\vert\vert\boldsymbol{\theta}\vert\vert_1, +C(\boldsymbol{\theta})=\sum_{i=0}^{p-1}(y_i-\theta_i)^2, $$ -

    Taking the derivative with respect to \( \boldsymbol{\theta} \) and recalling that the derivative of the absolute value is (we drop the boldfaced vector symbol for simplicity)

    +

    and minimizing we have that

    $$ -\frac{d \vert \theta\vert}{d \theta}=\mathrm{sgn}(\theta)=\left\{\begin{array}{cc} 1 & \theta > 0 \\-1 & \theta < 0, \end{array}\right. +\hat{\theta}_i^{\mathrm{OLS}} = y_i. $$ -

    we have that the derivative of the cost function is

    - -$$ -\frac{\partial C(\boldsymbol{X},\boldsymbol{\theta})}{\partial \boldsymbol{\theta}}=-\frac{2}{n}\boldsymbol{X}^T(\boldsymbol{y}-\boldsymbol{X}\boldsymbol{\theta})+\lambda sgn(\boldsymbol{\theta})=0, -$$ - -

    and reordering we have

    -$$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. -$$ - -

    This equation does not lead to a nice analytical equation as in Ridge regression or ordinary least squares. We have absorbed the factor \( 2/n \) in a redefinition of the parameter \( \lambda \). We will solve this type of problems using libraries like scikit-learn and using our own gradient descent code in project 1.

    @@ -392,7 +378,7 @@ $$

  • 69
  • 70
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs061.html b/doc/pub/week36/html/._week36-bs061.html index 13ddfb885..bcf9a51c2 100644 --- a/doc/pub/week36/html/._week36-bs061.html +++ b/doc/pub/week36/html/._week36-bs061.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,20 +336,16 @@ MathJax.Hub.Config({

     

     

     

    -

    Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression

    +

    Ridge Regression

    -

    Let us assume that our design matrix is given by unit (identity) matrix, that is a square diagonal matrix with ones only along the -diagonal. In this case we have an equal number of rows and columns \( n=p \). -

    - -

    Our model approximation is just \( \tilde{\boldsymbol{y}}=\boldsymbol{\theta} \) and the mean squared error and thereby the cost function for ordinary least sqquares (OLS) is then (we drop the term \( 1/n \))

    +

    For Ridge regression our cost function is

    $$ -C(\boldsymbol{\theta})=\sum_{i=0}^{p-1}(y_i-\theta_i)^2, +C(\boldsymbol{\theta})=\sum_{i=0}^{p-1}(y_i-\theta_i)^2+\lambda\sum_{i=0}^{p-1}\theta_i^2, $$

    and minimizing we have that

    $$ -\hat{\theta}_i^{\mathrm{OLS}} = y_i. +\hat{\theta}_i^{\mathrm{Ridge}} = \frac{y_i}{1+\lambda}. $$ @@ -383,7 +374,7 @@ $$
  • 70
  • 71
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs062.html b/doc/pub/week36/html/._week36-bs062.html index 7a20acf0a..c40e9cceb 100644 --- a/doc/pub/week36/html/._week36-bs062.html +++ b/doc/pub/week36/html/._week36-bs062.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,18 +336,26 @@ MathJax.Hub.Config({

     

     

     

    -

    Ridge Regression

    +

    Lasso Regression

    -

    For Ridge regression our cost function is

    +

    For Lasso regression our cost function is

    $$ -C(\boldsymbol{\theta})=\sum_{i=0}^{p-1}(y_i-\theta_i)^2+\lambda\sum_{i=0}^{p-1}\theta_i^2, +C(\boldsymbol{\theta})=\sum_{i=0}^{p-1}(y_i-\theta_i)^2+\lambda\sum_{i=0}^{p-1}\vert\theta_i\vert=\sum_{i=0}^{p-1}(y_i-\theta_i)^2+\lambda\sum_{i=0}^{p-1}\sqrt{\theta_i^2}, $$

    and minimizing we have that

    $$ -\hat{\theta}_i^{\mathrm{Ridge}} = \frac{y_i}{1+\lambda}. +-2\sum_{i=0}^{p-1}(y_i-\theta_i)+\lambda \sum_{i=0}^{p-1}\frac{(\theta_i)}{\vert\theta_i\vert}=0, $$ +

    which leads to

    +$$ +\hat{\boldsymbol{\theta}}_i^{\mathrm{Lasso}} = \left\{\begin{array}{ccc}y_i-\frac{\lambda}{2} &\mathrm{if} & y_i> \frac{\lambda}{2}\\ + y_i+\frac{\lambda}{2} &\mathrm{if} & y_i < -\frac{\lambda}{2}\\ + 0 &\mathrm{if} & \vert y_i\vert\le \frac{\lambda}{2}\end{array}\right.\\. +$$ + +

    Plotting these results shows clearly that Lasso regression suppresses (sets to zero) values of \( \theta_i \) for specific values of \( \lambda \). Ridge regression reduces on the other hand the values of \( \theta_i \) as function of \( \lambda \).

    @@ -378,8 +381,6 @@ $$

  • 70
  • 71
  • 72
  • -
  • ...
  • -
  • 73
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs063.html b/doc/pub/week36/html/._week36-bs063.html index c28962e46..16090df0d 100644 --- a/doc/pub/week36/html/._week36-bs063.html +++ b/doc/pub/week36/html/._week36-bs063.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,26 +336,20 @@ MathJax.Hub.Config({

     

     

     

    -

    Lasso Regression

    +

    Yet another Example

    + +

    Let us assume we have a data set with outputs/targets given by the vector

    -

    For Lasso regression our cost function is

    $$ -C(\boldsymbol{\theta})=\sum_{i=0}^{p-1}(y_i-\theta_i)^2+\lambda\sum_{i=0}^{p-1}\vert\theta_i\vert=\sum_{i=0}^{p-1}(y_i-\theta_i)^2+\lambda\sum_{i=0}^{p-1}\sqrt{\theta_i^2}, +\boldsymbol{y}=\begin{bmatrix}4 \\ 2 \\3\end{bmatrix}, $$ -

    and minimizing we have that

    +

    and our inputs as a \( 3\times 2 \) design matrix

    $$ --2\sum_{i=0}^{p-1}(y_i-\theta_i)+\lambda \sum_{i=0}^{p-1}\frac{(\theta_i)}{\vert\theta_i\vert}=0, +\boldsymbol{X}=\begin{bmatrix}2 & 0\\ 0 & 1 \\ 0 & 0\end{bmatrix}, $$ -

    which leads to

    -$$ -\hat{\boldsymbol{\theta}}_i^{\mathrm{Lasso}} = \left\{\begin{array}{ccc}y_i-\frac{\lambda}{2} &\mathrm{if} & y_i> \frac{\lambda}{2}\\ - y_i+\frac{\lambda}{2} &\mathrm{if} & y_i < -\frac{\lambda}{2}\\ - 0 &\mathrm{if} & \vert y_i\vert\le \frac{\lambda}{2}\end{array}\right.\\. -$$ - -

    Plotting these results shows clearly that Lasso regression suppresses (sets to zero) values of \( \theta_i \) for specific values of \( \lambda \). Ridge regression reduces on the other hand the values of \( \theta_i \) as function of \( \lambda \).

    +

    meaning that we have two features and two unknown parameters \( \theta_0 \) and \( \theta_1 \) to be determined either by ordinary least squares, Ridge or Lasso regression.

    @@ -385,7 +374,6 @@ $$

  • 70
  • 71
  • 72
  • -
  • 73
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs064.html b/doc/pub/week36/html/._week36-bs064.html index a667682bd..13448dfdb 100644 --- a/doc/pub/week36/html/._week36-bs064.html +++ b/doc/pub/week36/html/._week36-bs064.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,20 +336,21 @@ MathJax.Hub.Config({

     

     

     

    -

    Yet another Example

    +

    The OLS case

    -

    Let us assume we have a data set with outputs/targets given by the vector

    +

    For ordinary least squares (OLS) we know that the optimal solution is

    $$ -\boldsymbol{y}=\begin{bmatrix}4 \\ 2 \\3\end{bmatrix}, +\hat{\boldsymbol{\theta}}^{\mathrm{OLS}}=\left( \boldsymbol{X}^T\boldsymbol{X}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}. $$ -

    and our inputs as a \( 3\times 2 \) design matrix

    +

    Inserting the above values we obtain that

    + $$ -\boldsymbol{X}=\begin{bmatrix}2 & 0\\ 0 & 1 \\ 0 & 0\end{bmatrix}, +\hat{\boldsymbol{\theta}}^{\mathrm{OLS}}=\begin{bmatrix}2 \\ 2\end{bmatrix}, $$ -

    meaning that we have two features and two unknown parameters \( \theta_0 \) and \( \theta_1 \) to be determined either by ordinary least squares, Ridge or Lasso regression.

    +

    The code which implements this simpler case is presented after the discussion of Ridge and Lasso.

    @@ -378,7 +374,6 @@ $$

  • 70
  • 71
  • 72
  • -
  • 73
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs065.html b/doc/pub/week36/html/._week36-bs065.html index 32dbf4ce2..ef3b7a5ee 100644 --- a/doc/pub/week36/html/._week36-bs065.html +++ b/doc/pub/week36/html/._week36-bs065.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,21 +336,25 @@ MathJax.Hub.Config({

     

     

     

    -

    The OLS case

    +

    The Ridge case

    -

    For ordinary least squares (OLS) we know that the optimal solution is

    +

    For Ridge regression we have

    $$ -\hat{\boldsymbol{\theta}}^{\mathrm{OLS}}=\left( \boldsymbol{X}^T\boldsymbol{X}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}. +\hat{\boldsymbol{\theta}}^{\mathrm{Ridge}}=\left( \boldsymbol{X}^T\boldsymbol{X}+\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}. $$

    Inserting the above values we obtain that

    $$ -\hat{\boldsymbol{\theta}}^{\mathrm{OLS}}=\begin{bmatrix}2 \\ 2\end{bmatrix}, +\hat{\boldsymbol{\theta}}^{\mathrm{Ridge}}=\begin{bmatrix}\frac{8}{4+\lambda} \\ \frac{2}{1+\lambda}\end{bmatrix}, $$ -

    The code which implements this simpler case is presented after the discussion of Ridge and Lasso.

    +

    There is normally a constraint on the value of \( \vert\vert \boldsymbol{\theta}\vert\vert_2 \) via the parameter \( \lambda \). +Let us for simplicity assume that \( \theta_0^2+\theta_1^2=1 \) as constraint. This will allow us to find an expression for the optimal values of \( \theta \) and \( \lambda \). +

    + +

    To see this, let us write the cost function for Ridge regression.

    @@ -378,7 +377,6 @@ $$

  • 70
  • 71
  • 72
  • -
  • 73
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs066.html b/doc/pub/week36/html/._week36-bs066.html index 011fe817b..17019e7ee 100644 --- a/doc/pub/week36/html/._week36-bs066.html +++ b/doc/pub/week36/html/._week36-bs066.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,25 +336,34 @@ MathJax.Hub.Config({

     

     

     

    -

    The Ridge case

    - -

    For Ridge regression we have

    +

    Writing the Cost Function

    +

    We define the MSE without the \( 1/n \) factor and have then, using that

    $$ -\hat{\boldsymbol{\theta}}^{\mathrm{Ridge}}=\left( \boldsymbol{X}^T\boldsymbol{X}+\lambda\boldsymbol{I}\right)^{-1}\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}\boldsymbol{\theta}=\begin{bmatrix} 2\theta_0 \\ \theta_1 \\0 \end{bmatrix}, $$ -

    Inserting the above values we obtain that

    $$ -\hat{\boldsymbol{\theta}}^{\mathrm{Ridge}}=\begin{bmatrix}\frac{8}{4+\lambda} \\ \frac{2}{1+\lambda}\end{bmatrix}, +C(\boldsymbol{\theta})=(4-2\theta_0)^2+(2-\theta_1)^2+\lambda(\theta_0^2+\theta_1^2), $$ -

    There is normally a constraint on the value of \( \vert\vert \boldsymbol{\theta}\vert\vert_2 \) via the parameter \( \lambda \). -Let us for simplicity assume that \( \theta_0^2+\theta_1^2=1 \) as constraint. This will allow us to find an expression for the optimal values of \( \theta \) and \( \lambda \). -

    +

    and taking the derivative with respect to \( \theta_0 \) we get

    +$$ +\theta_0=\frac{8}{4+\lambda}, +$$ -

    To see this, let us write the cost function for Ridge regression.

    +

    and for \( \theta_1 \) we obtain

    +$$ +\theta_1=\frac{2}{1+\lambda}, +$$ + +

    Using the constraint for \( \theta_0^2+\theta_1^2=1 \) we can constrain \( \lambda \) by solving

    +$$ +\left(\frac{8}{4+\lambda}\right)^2+\left(\frac{2}{1+\lambda}\right)^2=1, +$$ + +

    which gives \( \lambda=4.571 \) and \( \theta_0=0.933 \) and \( \theta_1=0.359 \).

    @@ -381,7 +385,6 @@ Let us for simplicity assume that \( \theta_0^2+\theta_1^2=1 \) as constraint. T

  • 70
  • 71
  • 72
  • -
  • 73
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs067.html b/doc/pub/week36/html/._week36-bs067.html index c78cb4aab..7cb461218 100644 --- a/doc/pub/week36/html/._week36-bs067.html +++ b/doc/pub/week36/html/._week36-bs067.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,35 +336,32 @@ MathJax.Hub.Config({

     

     

     

    -

    Writing the Cost Function

    +

    Lasso case

    -

    We define the MSE without the \( 1/n \) factor and have then, using that

    +

    For Lasso we need now, keeping a constraint on \( \vert\theta_0\vert+\vert\theta_1\vert=1 \), to take the derivative of the absolute values of \( \theta_0 \) +and \( \theta_1 \). This gives us the following derivatives of the cost function +

    $$ -\boldsymbol{X}\boldsymbol{\theta}=\begin{bmatrix} 2\theta_0 \\ \theta_1 \\0 \end{bmatrix}, +C(\boldsymbol{\theta})=(4-2\theta_0)^2+(2-\theta_1)^2+\lambda(\vert\theta_0\vert+\vert\theta_1\vert), $$ $$ -C(\boldsymbol{\theta})=(4-2\theta_0)^2+(2-\theta_1)^2+\lambda(\theta_0^2+\theta_1^2), +\frac{\partial C(\boldsymbol{\theta})}{\partial \theta_0}=-4(4-2\theta_0)+\lambda\mathrm{sgn}(\theta_0)=0, $$ -

    and taking the derivative with respect to \( \theta_0 \) we get

    +

    and

    $$ -\theta_0=\frac{8}{4+\lambda}, +\frac{\partial C(\boldsymbol{\theta})}{\partial \theta_1}=-2(2-\theta_1)+\lambda\mathrm{sgn}(\theta_1)=0. $$ -

    and for \( \theta_1 \) we obtain

    -$$ -\theta_1=\frac{2}{1+\lambda}, -$$ - -

    Using the constraint for \( \theta_0^2+\theta_1^2=1 \) we can constrain \( \lambda \) by solving

    -$$ -\left(\frac{8}{4+\lambda}\right)^2+\left(\frac{2}{1+\lambda}\right)^2=1, -$$ - -

    which gives \( \lambda=4.571 \) and \( \theta_0=0.933 \) and \( \theta_1=0.359 \).

    - +

    We have now four cases to solve besides the trivial cases \( \theta_0 \) and/or \( \theta_1 \) are zero, namely

    +
      +
    1. \( \theta_0 > 0 \) and \( \theta_1 > 0 \),
    2. +
    3. \( \theta_0 > 0 \) and \( \theta_1 < 0 \),
    4. +
    5. \( \theta_0 < 0 \) and \( \theta_1 > 0 \),
    6. +
    7. \( \theta_0 < 0 \) and \( \theta_1 < 0 \).
    8. +

    diff --git a/doc/pub/week36/html/._week36-bs068.html b/doc/pub/week36/html/._week36-bs068.html index c45418372..d7df751af 100644 --- a/doc/pub/week36/html/._week36-bs068.html +++ b/doc/pub/week36/html/._week36-bs068.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,32 +336,31 @@ MathJax.Hub.Config({

     

     

     

    -

    Lasso case

    +

    The first Case

    -

    For Lasso we need now, keeping a constraint on \( \vert\theta_0\vert+\vert\theta_1\vert=1 \), to take the derivative of the absolute values of \( \theta_0 \) -and \( \theta_1 \). This gives us the following derivatives of the cost function -

    +

    If we consider the first case, we have then

    $$ -C(\boldsymbol{\theta})=(4-2\theta_0)^2+(2-\theta_1)^2+\lambda(\vert\theta_0\vert+\vert\theta_1\vert), -$$ - - -$$ -\frac{\partial C(\boldsymbol{\theta})}{\partial \theta_0}=-4(4-2\theta_0)+\lambda\mathrm{sgn}(\theta_0)=0, +-4(4-2\theta_0)+\lambda=0, $$

    and

    $$ -\frac{\partial C(\boldsymbol{\theta})}{\partial \theta_1}=-2(2-\theta_1)+\lambda\mathrm{sgn}(\theta_1)=0. +-2(2-\theta_1)+\lambda=0. $$ -

    We have now four cases to solve besides the trivial cases \( \theta_0 \) and/or \( \theta_1 \) are zero, namely

    -
      -
    1. \( \theta_0 > 0 \) and \( \theta_1 > 0 \),
    2. -
    3. \( \theta_0 > 0 \) and \( \theta_1 < 0 \),
    4. -
    5. \( \theta_0 < 0 \) and \( \theta_1 > 0 \),
    6. -
    7. \( \theta_0 < 0 \) and \( \theta_1 < 0 \).
    8. -
    +

    which yields

    + +$$ +\theta_0=\frac{16+\lambda}{8}, +$$ + +

    and

    +$$ +\theta_1=\frac{4+\lambda}{2}. +$$ + +

    Using the constraint on \( \theta_0 \) and \( \theta_1 \) we can then find the optimal value of \( \lambda \) for the different cases. We leave this as an exercise to you.

    +

    diff --git a/doc/pub/week36/html/._week36-bs069.html b/doc/pub/week36/html/._week36-bs069.html index 28f6102b6..d1e79269a 100644 --- a/doc/pub/week36/html/._week36-bs069.html +++ b/doc/pub/week36/html/._week36-bs069.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,30 +336,84 @@ MathJax.Hub.Config({

     

     

     

    -

    The first Case

    +

    Simple code for solving the above problem

    -

    If we consider the first case, we have then

    -$$ --4(4-2\theta_0)+\lambda=0, -$$ +

    Here we set up the OLS, Ridge and Lasso functionality in order to study the above example. Note that here we have opted for a set of values of \( \lambda \), meaning that we need to perform a search in order to find the optimal values.

    -

    and

    -$$ --2(2-\theta_1)+\lambda=0. -$$ +

    First we study and compare the OLS and Ridge results. The next code compares all three methods.

    -

    which yields

    -$$ -\theta_0=\frac{16+\lambda}{8}, -$$ + +
    +
    +
    +
    +
    +
    import os
    +import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
     
    -

    and

    -$$ -\theta_1=\frac{4+\lambda}{2}. -$$ +def R2(y_data, y_model): + return 1 - np.sum((y_data - y_model) ** 2) / np.sum((y_data - np.mean(y_data)) ** 2) +def MSE(y_data,y_model): + n = np.size(y_model) + return np.sum((y_data-y_model)**2)/n -

    Using the constraint on \( \theta_0 \) and \( \theta_1 \) we can then find the optimal value of \( \lambda \) for the different cases. We leave this as an exercise to you.

    + +# A seed just to ensure that the random numbers are the same for every run. +# Useful for eventual debugging. + +X = np.array( [ [ 2, 0], [0, 1], [0,0]]) +y = np.array( [4, 2, 3]) + + +# matrix inversion to find beta +OLSbeta = np.linalg.inv(X.T @ X) @ X.T @ y +print(OLSbeta) +# and then make the prediction +ytildeOLS = X @ OLSbeta +print("Training MSE for OLS") +print(MSE(y,ytildeOLS)) +ypredictOLS = X @ OLSbeta + +# Repeat now for Ridge regression and various values of the regularization parameter +I = np.eye(2,2) +# Decide which values of lambda to use +nlambdas = 100 +MSEPredict = np.zeros(nlambdas) +lambdas = np.logspace(-4, 4, nlambdas) +for i in range(nlambdas): + lmb = lambdas[i] + Ridgebeta = np.linalg.inv(X.T @ X+lmb*I) @ X.T @ y +# print(Ridgebeta) + # and then make the prediction + ypredictRidge = X @ Ridgebeta + MSEPredict[i] = MSE(y,ypredictRidge) +# print(MSEPredict[i]) + # Now plot the results +plt.figure() +plt.plot(np.log10(lambdas), MSEPredict, 'r--', label = 'MSE Ridge Train') +plt.xlabel('log10(lambda)') +plt.ylabel('MSE') +plt.legend() +plt.show() +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +

    We see here that we reach a plateau. What is actually happening?

    @@ -383,7 +432,6 @@ $$

  • 70
  • 71
  • 72
  • -
  • 73
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs070.html b/doc/pub/week36/html/._week36-bs070.html index 4f76bfcb1..73a5a9970 100644 --- a/doc/pub/week36/html/._week36-bs070.html +++ b/doc/pub/week36/html/._week36-bs070.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,11 +336,7 @@ MathJax.Hub.Config({

     

     

     

    -

    Simple code for solving the above problem

    - -

    Here we set up the OLS, Ridge and Lasso functionality in order to study the above example. Note that here we have opted for a set of values of \( \lambda \), meaning that we need to perform a search in order to find the optimal values.

    - -

    First we study and compare the OLS and Ridge results. The next code compares all three methods.

    +

    With Lasso Regression

    @@ -358,6 +349,7 @@ MathJax.Hub.Config({ import numpy as np import pandas as pd import matplotlib.pyplot as plt +from sklearn import linear_model def R2(y_data, y_model): return 1 - np.sum((y_data - y_model) ** 2) / np.sum((y_data - np.mean(y_data)) ** 2) @@ -386,19 +378,25 @@ ypredictOLS = X = np.eye(2,2) # Decide which values of lambda to use nlambdas = 100 -MSEPredict = np.zeros(nlambdas) +MSERidgePredict = np.zeros(nlambdas) +MSELassoPredict = np.zeros(nlambdas) lambdas = np.logspace(-4, 4, nlambdas) for i in range(nlambdas): lmb = lambdas[i] Ridgebeta = np.linalg.inv(X.T @ X+lmb*I) @ X.T @ y -# print(Ridgebeta) + print(Ridgebeta) # and then make the prediction ypredictRidge = X @ Ridgebeta - MSEPredict[i] = MSE(y,ypredictRidge) -# print(MSEPredict[i]) - # Now plot the results + MSERidgePredict[i] = MSE(y,ypredictRidge) + RegLasso = linear_model.Lasso(lmb,fit_intercept=False) + RegLasso.fit(X,y) + ypredictLasso = RegLasso.predict(X) + print(RegLasso.coef_) + MSELassoPredict[i] = MSE(y,ypredictLasso) +# Now plot the results plt.figure() -plt.plot(np.log10(lambdas), MSEPredict, 'r--', label = 'MSE Ridge Train') +plt.plot(np.log10(lambdas), MSERidgePredict, 'r--', label = 'MSE Ridge Train') +plt.plot(np.log10(lambdas), MSELassoPredict, 'r--', label = 'MSE Lasso Train') plt.xlabel('log10(lambda)') plt.ylabel('MSE') plt.legend() @@ -418,7 +416,6 @@ plt.show()
    -

    We see here that we reach a plateau. What is actually happening?

    @@ -436,7 +433,6 @@ plt.show()

  • 70
  • 71
  • 72
  • -
  • 73
  • »
  • diff --git a/doc/pub/week36/html/._week36-bs071.html b/doc/pub/week36/html/._week36-bs071.html index e7966d405..aa37adb2e 100644 --- a/doc/pub/week36/html/._week36-bs071.html +++ b/doc/pub/week36/html/._week36-bs071.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -341,7 +336,7 @@ MathJax.Hub.Config({

     

     

     

    -

    With Lasso Regression

    +

    Another Example, now with a polynomial fit

    @@ -354,6 +349,7 @@ MathJax.Hub.Config({ import numpy as np import pandas as pd import matplotlib.pyplot as plt +from sklearn.model_selection import train_test_split from sklearn import linear_model def R2(y_data, y_model): @@ -365,43 +361,64 @@ MathJax.Hub.Config({ # A seed just to ensure that the random numbers are the same for every run. # Useful for eventual debugging. +np.random.seed(3155) -X = np.array( [ [ 2, 0], [0, 1], [0,0]]) -y = np.array( [4, 2, 3]) +x = np.random.rand(100) +y = 2.0+5*x*x+0.1*np.random.randn(100) +# number of features p (here degree of polynomial +p = 3 +# The design matrix now as function of a given polynomial +X = np.zeros((len(x),p)) +X[:,0] = 1.0 +X[:,1] = x +X[:,2] = x*x +# We split the data in test and training data +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) # matrix inversion to find beta -OLSbeta = np.linalg.inv(X.T @ X) @ X.T @ y +OLSbeta = np.linalg.inv(X_train.T @ X_train) @ X_train.T @ y_train print(OLSbeta) # and then make the prediction -ytildeOLS = X @ OLSbeta +ytildeOLS = X_train @ OLSbeta print("Training MSE for OLS") -print(MSE(y,ytildeOLS)) -ypredictOLS = X @ OLSbeta +print(MSE(y_train,ytildeOLS)) +ypredictOLS = X_test @ OLSbeta +print("Test MSE OLS") +print(MSE(y_test,ypredictOLS)) -# Repeat now for Ridge regression and various values of the regularization parameter -I = np.eye(2,2) +# Repeat now for Lasso and Ridge regression and various values of the regularization parameter +I = np.eye(p,p) # Decide which values of lambda to use nlambdas = 100 -MSERidgePredict = np.zeros(nlambdas) +MSEPredict = np.zeros(nlambdas) +MSETrain = np.zeros(nlambdas) MSELassoPredict = np.zeros(nlambdas) +MSELassoTrain = np.zeros(nlambdas) lambdas = np.logspace(-4, 4, nlambdas) for i in range(nlambdas): lmb = lambdas[i] - Ridgebeta = np.linalg.inv(X.T @ X+lmb*I) @ X.T @ y - print(Ridgebeta) - # and then make the prediction - ypredictRidge = X @ Ridgebeta - MSERidgePredict[i] = MSE(y,ypredictRidge) + Ridgebeta = np.linalg.inv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train + # include lasso using Scikit-Learn RegLasso = linear_model.Lasso(lmb,fit_intercept=False) - RegLasso.fit(X,y) - ypredictLasso = RegLasso.predict(X) - print(RegLasso.coef_) - MSELassoPredict[i] = MSE(y,ypredictLasso) + RegLasso.fit(X_train,y_train) + # and then make the prediction + ytildeRidge = X_train @ Ridgebeta + ypredictRidge = X_test @ Ridgebeta + ytildeLasso = RegLasso.predict(X_train) + ypredictLasso = RegLasso.predict(X_test) + MSEPredict[i] = MSE(y_test,ypredictRidge) + MSETrain[i] = MSE(y_train,ytildeRidge) + MSELassoPredict[i] = MSE(y_test,ypredictLasso) + MSELassoTrain[i] = MSE(y_train,ytildeLasso) + # Now plot the results plt.figure() -plt.plot(np.log10(lambdas), MSERidgePredict, 'r--', label = 'MSE Ridge Train') -plt.plot(np.log10(lambdas), MSELassoPredict, 'r--', label = 'MSE Lasso Train') +plt.plot(np.log10(lambdas), MSETrain, label = 'MSE Ridge train') +plt.plot(np.log10(lambdas), MSEPredict, 'r--', label = 'MSE Ridge Test') +plt.plot(np.log10(lambdas), MSELassoTrain, label = 'MSE Lasso train') +plt.plot(np.log10(lambdas), MSELassoPredict, 'r--', label = 'MSE Lasso Test') + plt.xlabel('log10(lambda)') plt.ylabel('MSE') plt.legend() @@ -437,8 +454,6 @@ plt.show()
  • 70
  • 71
  • 72
  • -
  • 73
  • -
  • »
  • diff --git a/doc/pub/week36/html/week36-bs.html b/doc/pub/week36/html/week36-bs.html index f57c90ea1..58940ff0b 100644 --- a/doc/pub/week36/html/week36-bs.html +++ b/doc/pub/week36/html/week36-bs.html @@ -146,10 +146,6 @@ doconce format html week36.do.txt --html_style=bootstrap --pygments_html_style=d ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -266,8 +262,8 @@ MathJax.Hub.Config({
  • The singular value decomposition
  • Linear Regression Problems
  • Fixing the singularity
  • -
  • Ridge and LASSO Regression
  • -
  • Deriving the Ridge Regression Equations
  • +
  • Ridge and LASSO Regression
  • +
  • Deriving the Ridge Regression Equations
  • Basic math of the SVD
  • The SVD, a Fantastic Algorithm
  • Economy-size SVD
  • @@ -278,9 +274,9 @@ MathJax.Hub.Config({
  • Setting up the Matrix to be inverted
  • Further properties (important for our analyses later)
  • Back to Ridge and LASSO Regression
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • Optimization and gradient descent, the central part of any Machine Learning algortithm
  • Reminder on Newton-Raphson's method
  • The equations
  • @@ -301,35 +297,34 @@ MathJax.Hub.Config({
  • The Hessian matrix
  • Simple program
  • Gradient Descent Example
  • -
  • And a corresponding example using scikit-learn
  • -
  • Gradient descent and Ridge
  • -
  • The Hessian matrix for Ridge Regression
  • -
  • Program example for gradient descent with Ridge Regression
  • -
  • Using gradient descent methods, limitations
  • -
  • Material for lab sessions sessions Tuesday and Wednesday
  • -
  • Linear Regression and the SVD
  • -
  • What does it mean?
  • -
  • Ridge and LASSO Regression
  • -
  • From OLS to Ridge and Lasso
  • -
  • Deriving the Ridge Regression Equations
  • -
  • Note on Scikit-Learn
  • -
  • Comparison with OLS
  • -
  • SVD analysis
  • -
  • Interpreting the Ridge results
  • -
  • More interpretations
  • -
  • Deriving the Lasso Regression Equations
  • -
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • -
  • Ridge Regression
  • -
  • Lasso Regression
  • -
  • Yet another Example
  • -
  • The OLS case
  • -
  • The Ridge case
  • -
  • Writing the Cost Function
  • -
  • Lasso case
  • -
  • The first Case
  • -
  • Simple code for solving the above problem
  • -
  • With Lasso Regression
  • -
  • Another Example, now with a polynomial fit
  • +
  • Gradient descent and Ridge
  • +
  • The Hessian matrix for Ridge Regression
  • +
  • Program example for gradient descent with Ridge Regression
  • +
  • Using gradient descent methods, limitations
  • +
  • Material for lab sessions sessions Tuesday and Wednesday
  • +
  • Linear Regression and the SVD
  • +
  • What does it mean?
  • +
  • Ridge and LASSO Regression
  • +
  • From OLS to Ridge and Lasso
  • +
  • Deriving the Ridge Regression Equations
  • +
  • Note on Scikit-Learn
  • +
  • Comparison with OLS
  • +
  • SVD analysis
  • +
  • Interpreting the Ridge results
  • +
  • More interpretations
  • +
  • Deriving the Lasso Regression Equations
  • +
  • Simple example to illustrate Ordinary Least Squares, Ridge and Lasso Regression
  • +
  • Ridge Regression
  • +
  • Lasso Regression
  • +
  • Yet another Example
  • +
  • The OLS case
  • +
  • The Ridge case
  • +
  • Writing the Cost Function
  • +
  • Lasso case
  • +
  • The first Case
  • +
  • Simple code for solving the above problem
  • +
  • With Lasso Regression
  • +
  • Another Example, now with a polynomial fit
  • @@ -381,7 +376,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 73
  • +
  • 72
  • »
  • diff --git a/doc/pub/week36/html/week36-reveal.html b/doc/pub/week36/html/week36-reveal.html index 9555ec3ab..2cb299cb2 100644 --- a/doc/pub/week36/html/week36-reveal.html +++ b/doc/pub/week36/html/week36-reveal.html @@ -418,7 +418,7 @@ $$

    has linearly dependent column vectors, we will not be able to compute the inverse of \( \boldsymbol{X}^T\boldsymbol{X} \) and we cannot find the parameters (estimators) \( \theta_i \). -The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exits. +The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exists. This is more likely to happen when the matrix \( \boldsymbol{X} \) is high-dimensional. In this case it is likely to encounter a situation where the regression parameters \( \theta_i \) cannot be estimated.

    @@ -1279,14 +1279,14 @@ $$

    and reordering we have

     
    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

     

    We can redefine \( \lambda \) to absorb the constant \( n/2 \) and we rewrite the last equation as

     
    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

     
    @@ -1857,48 +1857,6 @@ plt.show() -

    -

    And a corresponding example using scikit-learn

    - - - -
    -
    -
    -
    -
    -
    # Importing various packages
    -from random import random, seed
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn.linear_model import SGDRegressor
    -
    -n = 100
    -x = 2*np.random.rand(n,1)
    -y = 4+3*x+np.random.randn(n,1)
    -
    -X = np.c_[np.ones((n,1)), x]
    -theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
    -print(theta_linreg)
    -sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
    -sgdreg.fit(x,y.ravel())
    -print(sgdreg.intercept_, sgdreg.coef_)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Gradient descent and Ridge

    diff --git a/doc/pub/week36/html/week36-solarized.html b/doc/pub/week36/html/week36-solarized.html index 30bfa6fd8..0da5f2ac4 100644 --- a/doc/pub/week36/html/week36-solarized.html +++ b/doc/pub/week36/html/week36-solarized.html @@ -173,10 +173,6 @@ div.toc p,a { ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -485,7 +481,7 @@ $$

    has linearly dependent column vectors, we will not be able to compute the inverse of \( \boldsymbol{X}^T\boldsymbol{X} \) and we cannot find the parameters (estimators) \( \theta_i \). -The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exits. +The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exists. This is more likely to happen when the matrix \( \boldsymbol{X} \) is high-dimensional. In this case it is likely to encounter a situation where the regression parameters \( \theta_i \) cannot be estimated.

    @@ -1223,12 +1219,12 @@ $$

    and reordering we have

    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

    We can redefine \( \lambda \) to absorb the constant \( n/2 \) and we rewrite the last equation as

    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

    This equation does not lead to a nice analytical equation as in either Ridge regression or ordinary least squares. This equation can however be solved by using standard convex optimization algorithms.We will discuss how to code the above methods using gradient descent methods.

    @@ -1738,48 +1734,6 @@ plt.show() -









    -

    And a corresponding example using scikit-learn

    - - - -
    -
    -
    -
    -
    -
    # Importing various packages
    -from random import random, seed
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn.linear_model import SGDRegressor
    -
    -n = 100
    -x = 2*np.random.rand(n,1)
    -y = 4+3*x+np.random.randn(n,1)
    -
    -X = np.c_[np.ones((n,1)), x]
    -theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
    -print(theta_linreg)
    -sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
    -sgdreg.fit(x,y.ravel())
    -print(sgdreg.intercept_, sgdreg.coef_)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    Gradient descent and Ridge

    diff --git a/doc/pub/week36/html/week36.html b/doc/pub/week36/html/week36.html index f848354a3..94f911021 100644 --- a/doc/pub/week36/html/week36.html +++ b/doc/pub/week36/html/week36.html @@ -250,10 +250,6 @@ div.toc p,a { ('The Hessian matrix', 2, None, 'the-hessian-matrix'), ('Simple program', 2, None, 'simple-program'), ('Gradient Descent Example', 2, None, 'gradient-descent-example'), - ('And a corresponding example using _scikit-learn_', - 2, - None, - 'and-a-corresponding-example-using-scikit-learn'), ('Gradient descent and Ridge', 2, None, @@ -562,7 +558,7 @@ $$

    has linearly dependent column vectors, we will not be able to compute the inverse of \( \boldsymbol{X}^T\boldsymbol{X} \) and we cannot find the parameters (estimators) \( \theta_i \). -The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exits. +The estimators are only well-defined if \( (\boldsymbol{X}^{T}\boldsymbol{X})^{-1} \) exists. This is more likely to happen when the matrix \( \boldsymbol{X} \) is high-dimensional. In this case it is likely to encounter a situation where the regression parameters \( \theta_i \) cannot be estimated.

    @@ -1300,12 +1296,12 @@ $$

    and reordering we have

    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\frac{n}{2}\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

    We can redefine \( \lambda \) to absorb the constant \( n/2 \) and we rewrite the last equation as

    $$ -\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=2\boldsymbol{X}^T\boldsymbol{y}. +\boldsymbol{X}^T\boldsymbol{X}\boldsymbol{\theta}+\lambda sgn(\boldsymbol{\theta})=\boldsymbol{X}^T\boldsymbol{y}. $$

    This equation does not lead to a nice analytical equation as in either Ridge regression or ordinary least squares. This equation can however be solved by using standard convex optimization algorithms.We will discuss how to code the above methods using gradient descent methods.

    @@ -1815,48 +1811,6 @@ plt.show() -









    -

    And a corresponding example using scikit-learn

    - - - -
    -
    -
    -
    -
    -
    # Importing various packages
    -from random import random, seed
    -import numpy as np
    -import matplotlib.pyplot as plt
    -from sklearn.linear_model import SGDRegressor
    -
    -n = 100
    -x = 2*np.random.rand(n,1)
    -y = 4+3*x+np.random.randn(n,1)
    -
    -X = np.c_[np.ones((n,1)), x]
    -theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
    -print(theta_linreg)
    -sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
    -sgdreg.fit(x,y.ravel())
    -print(sgdreg.intercept_, sgdreg.coef_)
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -

    Gradient descent and Ridge

    diff --git a/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz b/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz index 76a80034f..54702a8db 100644 Binary files a/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz and b/doc/pub/week36/ipynb/ipynb-week36-src.tar.gz differ diff --git a/doc/pub/week36/ipynb/week36.ipynb b/doc/pub/week36/ipynb/week36.ipynb index d03acd92b..d0d3dee3f 100644 --- a/doc/pub/week36/ipynb/week36.ipynb +++ b/doc/pub/week36/ipynb/week36.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b8f45e2d", + "id": "3586da6c", "metadata": { "editable": true }, @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "b3f2ead9", + "id": "5afa3a45", "metadata": { "editable": true }, @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "04553781", + "id": "739da2e4", "metadata": { "editable": true }, @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "1016bcdb", + "id": "66bc8f20", "metadata": { "editable": true }, @@ -67,7 +67,7 @@ }, { "cell_type": "markdown", - "id": "839e657a", + "id": "d6b147a8", "metadata": { "editable": true }, @@ -81,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "12dc9112", + "id": "69ee41c8", "metadata": { "editable": true }, @@ -93,7 +93,7 @@ }, { "cell_type": "markdown", - "id": "df3e7f6d", + "id": "eec38b3f", "metadata": { "editable": true }, @@ -105,7 +105,7 @@ }, { "cell_type": "markdown", - "id": "cc1caa8e", + "id": "7ca66dca", "metadata": { "editable": true }, @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "aaf95f40", + "id": "4a67a7b4", "metadata": { "editable": true }, @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "5e615b93", + "id": "4b3a2043", "metadata": { "editable": true }, @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "7f764f4e", + "id": "841bde50", "metadata": { "editable": true }, @@ -149,7 +149,7 @@ }, { "cell_type": "markdown", - "id": "4e0d9985", + "id": "ebca953b", "metadata": { "editable": true }, @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "a11e3b77", + "id": "7be2de84", "metadata": { "editable": true }, @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "b175d8ad", + "id": "9916c24e", "metadata": { "editable": true }, @@ -184,7 +184,7 @@ }, { "cell_type": "markdown", - "id": "0901c5d9", + "id": "03c35639", "metadata": { "editable": true }, @@ -196,7 +196,7 @@ }, { "cell_type": "markdown", - "id": "7263285d", + "id": "63aaa0d6", "metadata": { "editable": true }, @@ -206,7 +206,7 @@ }, { "cell_type": "markdown", - "id": "c0f54e1a", + "id": "563e4883", "metadata": { "editable": true }, @@ -218,7 +218,7 @@ }, { "cell_type": "markdown", - "id": "035835e7", + "id": "207fb037", "metadata": { "editable": true }, @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "a0dca7fe", + "id": "d0ebfe7a", "metadata": { "editable": true }, @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "5808efd5", + "id": "e5eba895", "metadata": { "editable": true }, @@ -252,7 +252,7 @@ }, { "cell_type": "markdown", - "id": "cca67bb8", + "id": "20736fd2", "metadata": { "editable": true }, @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "a189ce2b", + "id": "8ebaa24c", "metadata": { "editable": true }, @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "7835a4fb", + "id": "9e0e8b1b", "metadata": { "editable": true }, @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "1ba547c3", + "id": "a9dc6df7", "metadata": { "editable": true }, @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "55bc2c91", + "id": "4a1ebfbc", "metadata": { "editable": true }, @@ -341,7 +341,7 @@ }, { "cell_type": "markdown", - "id": "c702f5e0", + "id": "632a74c9", "metadata": { "editable": true }, @@ -364,7 +364,7 @@ }, { "cell_type": "markdown", - "id": "86cc8cb6", + "id": "d8173cef", "metadata": { "editable": true }, @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "1797b7e5", + "id": "8beab768", "metadata": { "editable": true }, @@ -400,7 +400,7 @@ }, { "cell_type": "markdown", - "id": "dc73a5a2", + "id": "7f8598e9", "metadata": { "editable": true }, @@ -411,7 +411,7 @@ }, { "cell_type": "markdown", - "id": "20b19ac5", + "id": "55c77d47", "metadata": { "editable": true }, @@ -423,7 +423,7 @@ }, { "cell_type": "markdown", - "id": "c269e5e9", + "id": "695e94a9", "metadata": { "editable": true }, @@ -441,14 +441,14 @@ }, { "cell_type": "markdown", - "id": "64cdb37b", + "id": "7cf05588", "metadata": { "editable": true }, "source": [ "has linearly dependent column vectors, we will not be able to compute the inverse\n", "of $\\boldsymbol{X}^T\\boldsymbol{X}$ and we cannot find the parameters (estimators) $\\theta_i$. \n", - "The estimators are only well-defined if $(\\boldsymbol{X}^{T}\\boldsymbol{X})^{-1}$ exits. \n", + "The estimators are only well-defined if $(\\boldsymbol{X}^{T}\\boldsymbol{X})^{-1}$ exists. \n", "This is more likely to happen when the matrix $\\boldsymbol{X}$ is high-dimensional. In this case it is likely to encounter a situation where \n", "the regression parameters $\\theta_i$ cannot be estimated.\n", "\n", @@ -457,7 +457,7 @@ }, { "cell_type": "markdown", - "id": "3e6e5a3e", + "id": "bed94018", "metadata": { "editable": true }, @@ -469,7 +469,7 @@ }, { "cell_type": "markdown", - "id": "fd83bb4b", + "id": "aae1d2f2", "metadata": { "editable": true }, @@ -479,7 +479,7 @@ }, { "cell_type": "markdown", - "id": "45b376e8", + "id": "d7b1e50f", "metadata": { "editable": true }, @@ -492,7 +492,7 @@ }, { "cell_type": "markdown", - "id": "90bb63a4", + "id": "5aaa4dd5", "metadata": { "editable": true }, @@ -504,7 +504,7 @@ }, { "cell_type": "markdown", - "id": "de110cca", + "id": "23b4b363", "metadata": { "editable": true }, @@ -514,7 +514,7 @@ }, { "cell_type": "markdown", - "id": "a8f75c00", + "id": "0d156e68", "metadata": { "editable": true }, @@ -527,7 +527,7 @@ }, { "cell_type": "markdown", - "id": "e3d1ecbd", + "id": "386fac67", "metadata": { "editable": true }, @@ -537,7 +537,7 @@ }, { "cell_type": "markdown", - "id": "a932ed24", + "id": "e0083fa6", "metadata": { "editable": true }, @@ -549,7 +549,7 @@ }, { "cell_type": "markdown", - "id": "9ec04c56", + "id": "c3bf20b5", "metadata": { "editable": true }, @@ -562,7 +562,7 @@ }, { "cell_type": "markdown", - "id": "c191b236", + "id": "8a09eb45", "metadata": { "editable": true }, @@ -575,7 +575,7 @@ }, { "cell_type": "markdown", - "id": "214affcd", + "id": "b9e924fa", "metadata": { "editable": true }, @@ -587,7 +587,7 @@ }, { "cell_type": "markdown", - "id": "cebe8ac0", + "id": "14e649b1", "metadata": { "editable": true }, @@ -599,7 +599,7 @@ }, { "cell_type": "markdown", - "id": "a10a36e8", + "id": "2357300f", "metadata": { "editable": true }, @@ -609,7 +609,7 @@ }, { "cell_type": "markdown", - "id": "51e17519", + "id": "d5b9128f", "metadata": { "editable": true }, @@ -622,7 +622,7 @@ }, { "cell_type": "markdown", - "id": "eb706113", + "id": "9b8f2719", "metadata": { "editable": true }, @@ -634,7 +634,7 @@ }, { "cell_type": "markdown", - "id": "f2252659", + "id": "ccaec8bc", "metadata": { "editable": true }, @@ -646,7 +646,7 @@ }, { "cell_type": "markdown", - "id": "bcf67e2c", + "id": "b9bbc55c", "metadata": { "editable": true }, @@ -658,7 +658,7 @@ }, { "cell_type": "markdown", - "id": "4053a663", + "id": "4c128865", "metadata": { "editable": true }, @@ -670,7 +670,7 @@ }, { "cell_type": "markdown", - "id": "8c8d8ce5", + "id": "d9b05a5a", "metadata": { "editable": true }, @@ -684,7 +684,7 @@ }, { "cell_type": "markdown", - "id": "fd306ffb", + "id": "4c3de377", "metadata": { "editable": true }, @@ -696,7 +696,7 @@ }, { "cell_type": "markdown", - "id": "f819a5cd", + "id": "64b28254", "metadata": { "editable": true }, @@ -706,7 +706,7 @@ }, { "cell_type": "markdown", - "id": "95c2e048", + "id": "8123860e", "metadata": { "editable": true }, @@ -718,7 +718,7 @@ }, { "cell_type": "markdown", - "id": "071a983e", + "id": "0e327aac", "metadata": { "editable": true }, @@ -730,7 +730,7 @@ }, { "cell_type": "markdown", - "id": "36d40252", + "id": "134d6cb8", "metadata": { "editable": true }, @@ -742,7 +742,7 @@ }, { "cell_type": "markdown", - "id": "e70d5af4", + "id": "97d5602d", "metadata": { "editable": true }, @@ -754,7 +754,7 @@ }, { "cell_type": "markdown", - "id": "d0becda4", + "id": "90137256", "metadata": { "editable": true }, @@ -766,7 +766,7 @@ }, { "cell_type": "markdown", - "id": "c8ee3aff", + "id": "cfd34e4d", "metadata": { "editable": true }, @@ -789,13 +789,10 @@ { "cell_type": "code", "execution_count": 1, - "id": "19ea825b", + "id": "35da6db9", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, "outputs": [], "source": [ @@ -870,7 +867,7 @@ }, { "cell_type": "markdown", - "id": "85080d04", + "id": "2c678f39", "metadata": { "editable": true }, @@ -882,7 +879,7 @@ }, { "cell_type": "markdown", - "id": "cefa4cb7", + "id": "cf9d2b92", "metadata": { "editable": true }, @@ -897,7 +894,7 @@ }, { "cell_type": "markdown", - "id": "10147fa0", + "id": "e1a5fd8a", "metadata": { "editable": true }, @@ -909,7 +906,7 @@ }, { "cell_type": "markdown", - "id": "2405041d", + "id": "7f511458", "metadata": { "editable": true }, @@ -919,7 +916,7 @@ }, { "cell_type": "markdown", - "id": "a1a6b707", + "id": "c40d1b84", "metadata": { "editable": true }, @@ -931,7 +928,7 @@ }, { "cell_type": "markdown", - "id": "ae672df8", + "id": "045cf436", "metadata": { "editable": true }, @@ -941,7 +938,7 @@ }, { "cell_type": "markdown", - "id": "53ea5d3b", + "id": "2c532237", "metadata": { "editable": true }, @@ -953,7 +950,7 @@ }, { "cell_type": "markdown", - "id": "19d5965a", + "id": "ac5cf334", "metadata": { "editable": true }, @@ -965,7 +962,7 @@ }, { "cell_type": "markdown", - "id": "20608e44", + "id": "e2bd47a2", "metadata": { "editable": true }, @@ -980,7 +977,7 @@ }, { "cell_type": "markdown", - "id": "7a04cc8a", + "id": "ce9b602b", "metadata": { "editable": true }, @@ -991,7 +988,7 @@ }, { "cell_type": "markdown", - "id": "77a30599", + "id": "71339dde", "metadata": { "editable": true }, @@ -1011,7 +1008,7 @@ }, { "cell_type": "markdown", - "id": "e97e9982", + "id": "93b3d2ca", "metadata": { "editable": true }, @@ -1023,7 +1020,7 @@ }, { "cell_type": "markdown", - "id": "6b89ea8c", + "id": "b13455c8", "metadata": { "editable": true }, @@ -1033,7 +1030,7 @@ }, { "cell_type": "markdown", - "id": "148873d3", + "id": "74108a43", "metadata": { "editable": true }, @@ -1045,7 +1042,7 @@ }, { "cell_type": "markdown", - "id": "b008fef3", + "id": "ee5ebfa5", "metadata": { "editable": true }, @@ -1074,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "82103acd", + "id": "6eb960f4", "metadata": { "editable": true }, @@ -1101,7 +1098,7 @@ }, { "cell_type": "markdown", - "id": "4fea6570", + "id": "cc951a64", "metadata": { "editable": true }, @@ -1112,13 +1109,10 @@ { "cell_type": "code", "execution_count": 2, - "id": "ac796dd0", + "id": "a08edf11", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, "outputs": [], "source": [ @@ -1155,7 +1149,7 @@ }, { "cell_type": "markdown", - "id": "db53512b", + "id": "c5f84b6d", "metadata": { "editable": true }, @@ -1172,7 +1166,7 @@ }, { "cell_type": "markdown", - "id": "502d1308", + "id": "3e6537bc", "metadata": { "editable": true }, @@ -1195,7 +1189,7 @@ }, { "cell_type": "markdown", - "id": "8c2bb770", + "id": "c4b0d7d0", "metadata": { "editable": true }, @@ -1209,7 +1203,7 @@ }, { "cell_type": "markdown", - "id": "ee7c0203", + "id": "2710e74d", "metadata": { "editable": true }, @@ -1228,7 +1222,7 @@ }, { "cell_type": "markdown", - "id": "672a491b", + "id": "d33e794c", "metadata": { "editable": true }, @@ -1238,7 +1232,7 @@ }, { "cell_type": "markdown", - "id": "8e3af41a", + "id": "6940c156", "metadata": { "editable": true }, @@ -1250,7 +1244,7 @@ }, { "cell_type": "markdown", - "id": "3c0db076", + "id": "0a9fa0f9", "metadata": { "editable": true }, @@ -1264,7 +1258,7 @@ }, { "cell_type": "markdown", - "id": "a6c05d18", + "id": "2ac8bc02", "metadata": { "editable": true }, @@ -1276,7 +1270,7 @@ }, { "cell_type": "markdown", - "id": "ff6c524a", + "id": "f6197461", "metadata": { "editable": true }, @@ -1286,7 +1280,7 @@ }, { "cell_type": "markdown", - "id": "ccca66ed", + "id": "7fa22eba", "metadata": { "editable": true }, @@ -1298,7 +1292,7 @@ }, { "cell_type": "markdown", - "id": "da2a1c44", + "id": "a70285f6", "metadata": { "editable": true }, @@ -1315,7 +1309,7 @@ }, { "cell_type": "markdown", - "id": "2f2704ab", + "id": "bf5774b8", "metadata": { "editable": true }, @@ -1325,7 +1319,7 @@ }, { "cell_type": "markdown", - "id": "e7286128", + "id": "8ca229ff", "metadata": { "editable": true }, @@ -1341,7 +1335,7 @@ }, { "cell_type": "markdown", - "id": "560e14d4", + "id": "b6bf96ea", "metadata": { "editable": true }, @@ -1351,7 +1345,7 @@ }, { "cell_type": "markdown", - "id": "5f35139c", + "id": "d49ba9c3", "metadata": { "editable": true }, @@ -1367,7 +1361,7 @@ }, { "cell_type": "markdown", - "id": "a5732633", + "id": "183d0b9c", "metadata": { "editable": true }, @@ -1377,7 +1371,7 @@ }, { "cell_type": "markdown", - "id": "cb54add9", + "id": "5442ca49", "metadata": { "editable": true }, @@ -1393,7 +1387,7 @@ }, { "cell_type": "markdown", - "id": "f03fc8ea", + "id": "823779a1", "metadata": { "editable": true }, @@ -1403,7 +1397,7 @@ }, { "cell_type": "markdown", - "id": "d686fb8e", + "id": "bc9b3b47", "metadata": { "editable": true }, @@ -1420,7 +1414,7 @@ }, { "cell_type": "markdown", - "id": "3b44a880", + "id": "db89583c", "metadata": { "editable": true }, @@ -1432,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "d2dcc6d7", + "id": "cbb0223f", "metadata": { "editable": true }, @@ -1444,7 +1438,7 @@ }, { "cell_type": "markdown", - "id": "a2f18583", + "id": "3388eb62", "metadata": { "editable": true }, @@ -1456,7 +1450,7 @@ }, { "cell_type": "markdown", - "id": "1b1b3ce0", + "id": "37c056f5", "metadata": { "editable": true }, @@ -1466,7 +1460,7 @@ }, { "cell_type": "markdown", - "id": "d96fcd4a", + "id": "bbbad4ae", "metadata": { "editable": true }, @@ -1478,7 +1472,7 @@ }, { "cell_type": "markdown", - "id": "98506ca6", + "id": "23ebbb1c", "metadata": { "editable": true }, @@ -1490,7 +1484,7 @@ }, { "cell_type": "markdown", - "id": "f7df719c", + "id": "bdcfe054", "metadata": { "editable": true }, @@ -1502,7 +1496,7 @@ }, { "cell_type": "markdown", - "id": "1263babe", + "id": "3f26e5a9", "metadata": { "editable": true }, @@ -1512,7 +1506,7 @@ }, { "cell_type": "markdown", - "id": "13a792f3", + "id": "ab396718", "metadata": { "editable": true }, @@ -1524,7 +1518,7 @@ }, { "cell_type": "markdown", - "id": "ff69a1d7", + "id": "8ef06c70", "metadata": { "editable": true }, @@ -1534,7 +1528,7 @@ }, { "cell_type": "markdown", - "id": "7e4a31aa", + "id": "13417de5", "metadata": { "editable": true }, @@ -1546,7 +1540,7 @@ }, { "cell_type": "markdown", - "id": "50768853", + "id": "0e6345d4", "metadata": { "editable": true }, @@ -1563,7 +1557,7 @@ }, { "cell_type": "markdown", - "id": "e70b34dc", + "id": "83a8abf0", "metadata": { "editable": true }, @@ -1575,7 +1569,7 @@ }, { "cell_type": "markdown", - "id": "e505b123", + "id": "6f8e392e", "metadata": { "editable": true }, @@ -1587,7 +1581,7 @@ }, { "cell_type": "markdown", - "id": "e143b570", + "id": "f8af87f5", "metadata": { "editable": true }, @@ -1597,7 +1591,7 @@ }, { "cell_type": "markdown", - "id": "5135ebb4", + "id": "a00ee63c", "metadata": { "editable": true }, @@ -1609,7 +1603,7 @@ }, { "cell_type": "markdown", - "id": "07ce9ec4", + "id": "489ab15e", "metadata": { "editable": true }, @@ -1620,7 +1614,7 @@ }, { "cell_type": "markdown", - "id": "80932acf", + "id": "6e6bc889", "metadata": { "editable": true }, @@ -1632,7 +1626,7 @@ }, { "cell_type": "markdown", - "id": "73eeda35", + "id": "06429f0f", "metadata": { "editable": true }, @@ -1642,7 +1636,7 @@ }, { "cell_type": "markdown", - "id": "47aff789", + "id": "1ddbfde2", "metadata": { "editable": true }, @@ -1654,7 +1648,7 @@ }, { "cell_type": "markdown", - "id": "2460c817", + "id": "3a910378", "metadata": { "editable": true }, @@ -1664,7 +1658,7 @@ }, { "cell_type": "markdown", - "id": "5e3b0d9c", + "id": "b03e080e", "metadata": { "editable": true }, @@ -1676,7 +1670,7 @@ }, { "cell_type": "markdown", - "id": "fbf2cb86", + "id": "925e17ec", "metadata": { "editable": true }, @@ -1687,7 +1681,7 @@ }, { "cell_type": "markdown", - "id": "ebce4ea0", + "id": "6825e5f1", "metadata": { "editable": true }, @@ -1699,7 +1693,7 @@ }, { "cell_type": "markdown", - "id": "2795da2d", + "id": "fe851d64", "metadata": { "editable": true }, @@ -1717,7 +1711,7 @@ }, { "cell_type": "markdown", - "id": "6a26ccff", + "id": "40e14e19", "metadata": { "editable": true }, @@ -1730,7 +1724,7 @@ }, { "cell_type": "markdown", - "id": "702137ae", + "id": "7a7da817", "metadata": { "editable": true }, @@ -1742,7 +1736,7 @@ }, { "cell_type": "markdown", - "id": "6df222d6", + "id": "815d4798", "metadata": { "editable": true }, @@ -1752,7 +1746,7 @@ }, { "cell_type": "markdown", - "id": "9cc370f4", + "id": "9d5e0b49", "metadata": { "editable": true }, @@ -1765,7 +1759,7 @@ }, { "cell_type": "markdown", - "id": "9a71ac65", + "id": "ef2a20e5", "metadata": { "editable": true }, @@ -1775,7 +1769,7 @@ }, { "cell_type": "markdown", - "id": "c4242498", + "id": "7ce0f92d", "metadata": { "editable": true }, @@ -1787,7 +1781,7 @@ }, { "cell_type": "markdown", - "id": "6deb1e52", + "id": "5cca9be8", "metadata": { "editable": true }, @@ -1800,7 +1794,7 @@ }, { "cell_type": "markdown", - "id": "4b9320dd", + "id": "fc5e1f2c", "metadata": { "editable": true }, @@ -1813,7 +1807,7 @@ }, { "cell_type": "markdown", - "id": "43cca84c", + "id": "c9cb5c03", "metadata": { "editable": true }, @@ -1825,7 +1819,7 @@ }, { "cell_type": "markdown", - "id": "91672a95", + "id": "3a4a16f9", "metadata": { "editable": true }, @@ -1837,7 +1831,7 @@ }, { "cell_type": "markdown", - "id": "f3e9c0e4", + "id": "de9d17d1", "metadata": { "editable": true }, @@ -1847,7 +1841,7 @@ }, { "cell_type": "markdown", - "id": "0cc6fab9", + "id": "a25cf6f8", "metadata": { "editable": true }, @@ -1860,7 +1854,7 @@ }, { "cell_type": "markdown", - "id": "71f360d2", + "id": "cca2f8c4", "metadata": { "editable": true }, @@ -1872,7 +1866,7 @@ }, { "cell_type": "markdown", - "id": "7a27d39c", + "id": "d02c6998", "metadata": { "editable": true }, @@ -1884,7 +1878,7 @@ }, { "cell_type": "markdown", - "id": "d554f3b2", + "id": "19b2ac7d", "metadata": { "editable": true }, @@ -1901,7 +1895,7 @@ }, { "cell_type": "markdown", - "id": "e9597e67", + "id": "f2d4c46a", "metadata": { "editable": true }, @@ -1913,7 +1907,7 @@ }, { "cell_type": "markdown", - "id": "d0c80c08", + "id": "c084dde9", "metadata": { "editable": true }, @@ -1923,7 +1917,7 @@ }, { "cell_type": "markdown", - "id": "2b33f0e5", + "id": "3bacabfd", "metadata": { "editable": true }, @@ -1935,7 +1929,7 @@ }, { "cell_type": "markdown", - "id": "7db2a530", + "id": "6ac8a1a8", "metadata": { "editable": true }, @@ -1945,7 +1939,7 @@ }, { "cell_type": "markdown", - "id": "177b3058", + "id": "43eb347b", "metadata": { "editable": true }, @@ -1957,7 +1951,7 @@ }, { "cell_type": "markdown", - "id": "304c0b90", + "id": "11e0a485", "metadata": { "editable": true }, @@ -1969,7 +1963,7 @@ }, { "cell_type": "markdown", - "id": "14936ac3", + "id": "012a0ea1", "metadata": { "editable": true }, @@ -1985,7 +1979,7 @@ }, { "cell_type": "markdown", - "id": "797ca0aa", + "id": "1f8bf06b", "metadata": { "editable": true }, @@ -1997,7 +1991,7 @@ }, { "cell_type": "markdown", - "id": "a469a907", + "id": "afbc2061", "metadata": { "editable": true }, @@ -2009,7 +2003,7 @@ }, { "cell_type": "markdown", - "id": "e9452a64", + "id": "22d903c1", "metadata": { "editable": true }, @@ -2019,7 +2013,7 @@ }, { "cell_type": "markdown", - "id": "699b712d", + "id": "09655feb", "metadata": { "editable": true }, @@ -2031,7 +2025,7 @@ }, { "cell_type": "markdown", - "id": "e4af99e7", + "id": "976449ac", "metadata": { "editable": true }, @@ -2041,7 +2035,7 @@ }, { "cell_type": "markdown", - "id": "a5a8ee8c", + "id": "3aeb28d8", "metadata": { "editable": true }, @@ -2053,7 +2047,7 @@ }, { "cell_type": "markdown", - "id": "03c00df5", + "id": "59348b08", "metadata": { "editable": true }, @@ -2070,7 +2064,7 @@ }, { "cell_type": "markdown", - "id": "023042c7", + "id": "a3a38146", "metadata": { "editable": true }, @@ -2082,7 +2076,7 @@ }, { "cell_type": "markdown", - "id": "b0cd7107", + "id": "4de2d8d6", "metadata": { "editable": true }, @@ -2094,7 +2088,7 @@ }, { "cell_type": "markdown", - "id": "4c34ce5f", + "id": "5539ce38", "metadata": { "editable": true }, @@ -2104,7 +2098,7 @@ }, { "cell_type": "markdown", - "id": "d489ea51", + "id": "519481d2", "metadata": { "editable": true }, @@ -2116,7 +2110,7 @@ }, { "cell_type": "markdown", - "id": "9921bc50", + "id": "433bee8f", "metadata": { "editable": true }, @@ -2126,7 +2120,7 @@ }, { "cell_type": "markdown", - "id": "c568250e", + "id": "afea6f71", "metadata": { "editable": true }, @@ -2138,7 +2132,7 @@ }, { "cell_type": "markdown", - "id": "21d0b485", + "id": "32b32b42", "metadata": { "editable": true }, @@ -2148,19 +2142,19 @@ }, { "cell_type": "markdown", - "id": "6722483b", + "id": "54a0c1f6", "metadata": { "editable": true }, "source": [ "$$\n", - "\\boldsymbol{X}^T\\boldsymbol{X}\\boldsymbol{\\theta}+\\frac{n}{2}\\lambda sgn(\\boldsymbol{\\theta})=2\\boldsymbol{X}^T\\boldsymbol{y}.\n", + "\\boldsymbol{X}^T\\boldsymbol{X}\\boldsymbol{\\theta}+\\frac{n}{2}\\lambda sgn(\\boldsymbol{\\theta})=\\boldsymbol{X}^T\\boldsymbol{y}.\n", "$$" ] }, { "cell_type": "markdown", - "id": "9777f5cc", + "id": "ec7d68de", "metadata": { "editable": true }, @@ -2170,19 +2164,19 @@ }, { "cell_type": "markdown", - "id": "23101fe6", + "id": "d26bacac", "metadata": { "editable": true }, "source": [ "$$\n", - "\\boldsymbol{X}^T\\boldsymbol{X}\\boldsymbol{\\theta}+\\lambda sgn(\\boldsymbol{\\theta})=2\\boldsymbol{X}^T\\boldsymbol{y}.\n", + "\\boldsymbol{X}^T\\boldsymbol{X}\\boldsymbol{\\theta}+\\lambda sgn(\\boldsymbol{\\theta})=\\boldsymbol{X}^T\\boldsymbol{y}.\n", "$$" ] }, { "cell_type": "markdown", - "id": "4f604170", + "id": "ac45c3e5", "metadata": { "editable": true }, @@ -2192,7 +2186,7 @@ }, { "cell_type": "markdown", - "id": "5c7b9070", + "id": "451fbbf2", "metadata": { "editable": true }, @@ -2211,7 +2205,7 @@ }, { "cell_type": "markdown", - "id": "0af8105c", + "id": "e0569839", "metadata": { "editable": true }, @@ -2231,7 +2225,7 @@ }, { "cell_type": "markdown", - "id": "c93d44b0", + "id": "de0e44d6", "metadata": { "editable": true }, @@ -2247,7 +2241,7 @@ }, { "cell_type": "markdown", - "id": "b1c868cd", + "id": "bae50b3b", "metadata": { "editable": true }, @@ -2263,7 +2257,7 @@ }, { "cell_type": "markdown", - "id": "7c257671", + "id": "2cc7033f", "metadata": { "editable": true }, @@ -2274,7 +2268,7 @@ }, { "cell_type": "markdown", - "id": "ddc77aef", + "id": "c4ca8926", "metadata": { "editable": true }, @@ -2286,7 +2280,7 @@ }, { "cell_type": "markdown", - "id": "026777a7", + "id": "1eaf376f", "metadata": { "editable": true }, @@ -2296,7 +2290,7 @@ }, { "cell_type": "markdown", - "id": "3707790b", + "id": "9c025697", "metadata": { "editable": true }, @@ -2308,7 +2302,7 @@ }, { "cell_type": "markdown", - "id": "13ab6bec", + "id": "2d64abe7", "metadata": { "editable": true }, @@ -2318,7 +2312,7 @@ }, { "cell_type": "markdown", - "id": "0a6d69ef", + "id": "b83c29d5", "metadata": { "editable": true }, @@ -2330,7 +2324,7 @@ }, { "cell_type": "markdown", - "id": "336ec1b1", + "id": "cfcc809e", "metadata": { "editable": true }, @@ -2352,7 +2346,7 @@ }, { "cell_type": "markdown", - "id": "3081ba44", + "id": "bdaa56d1", "metadata": { "editable": true }, @@ -2365,7 +2359,7 @@ }, { "cell_type": "markdown", - "id": "5c3faff2", + "id": "ffa4afe6", "metadata": { "editable": true }, @@ -2378,7 +2372,7 @@ }, { "cell_type": "markdown", - "id": "68fd52c0", + "id": "5c6b9239", "metadata": { "editable": true }, @@ -2388,7 +2382,7 @@ }, { "cell_type": "markdown", - "id": "5e29a567", + "id": "5ddb446d", "metadata": { "editable": true }, @@ -2406,7 +2400,7 @@ }, { "cell_type": "markdown", - "id": "f787c3a2", + "id": "9a0a5b04", "metadata": { "editable": true }, @@ -2416,7 +2410,7 @@ }, { "cell_type": "markdown", - "id": "1c5e1214", + "id": "6fe881ee", "metadata": { "editable": true }, @@ -2431,7 +2425,7 @@ }, { "cell_type": "markdown", - "id": "1cdd5ba1", + "id": "83b83194", "metadata": { "editable": true }, @@ -2441,7 +2435,7 @@ }, { "cell_type": "markdown", - "id": "276e07a3", + "id": "09e77119", "metadata": { "editable": true }, @@ -2455,7 +2449,7 @@ }, { "cell_type": "markdown", - "id": "80fe7f13", + "id": "afdce492", "metadata": { "editable": true }, @@ -2465,7 +2459,7 @@ }, { "cell_type": "markdown", - "id": "e8838b8f", + "id": "b6e29c29", "metadata": { "editable": true }, @@ -2479,7 +2473,7 @@ }, { "cell_type": "markdown", - "id": "2ed6fbd0", + "id": "ad6e09d7", "metadata": { "editable": true }, @@ -2494,7 +2488,7 @@ }, { "cell_type": "markdown", - "id": "0796429c", + "id": "a514df33", "metadata": { "editable": true }, @@ -2511,7 +2505,7 @@ }, { "cell_type": "markdown", - "id": "fc44df4f", + "id": "ae758019", "metadata": { "editable": true }, @@ -2523,7 +2517,7 @@ }, { "cell_type": "markdown", - "id": "c88146a9", + "id": "1bcffe5e", "metadata": { "editable": true }, @@ -2537,7 +2531,7 @@ }, { "cell_type": "markdown", - "id": "d1b85445", + "id": "67467328", "metadata": { "editable": true }, @@ -2552,7 +2546,7 @@ }, { "cell_type": "markdown", - "id": "8edde795", + "id": "4bac20b4", "metadata": { "editable": true }, @@ -2564,7 +2558,7 @@ }, { "cell_type": "markdown", - "id": "f92e4583", + "id": "01e84611", "metadata": { "editable": true }, @@ -2575,7 +2569,7 @@ }, { "cell_type": "markdown", - "id": "0bf80264", + "id": "8f742c3b", "metadata": { "editable": true }, @@ -2603,7 +2597,7 @@ }, { "cell_type": "markdown", - "id": "5b6b24c7", + "id": "77acd12d", "metadata": { "editable": true }, @@ -2625,7 +2619,7 @@ }, { "cell_type": "markdown", - "id": "e36297bd", + "id": "99ab46db", "metadata": { "editable": true }, @@ -2647,7 +2641,7 @@ }, { "cell_type": "markdown", - "id": "f8ec331d", + "id": "5b4b6243", "metadata": { "editable": true }, @@ -2659,7 +2653,7 @@ }, { "cell_type": "markdown", - "id": "0b0d0c67", + "id": "2ba66a00", "metadata": { "editable": true }, @@ -2696,7 +2690,7 @@ }, { "cell_type": "markdown", - "id": "bdfac28b", + "id": "c9a65dbe", "metadata": { "editable": true }, @@ -2724,7 +2718,7 @@ }, { "cell_type": "markdown", - "id": "2032fb83", + "id": "7efa8d14", "metadata": { "editable": true }, @@ -2754,7 +2748,7 @@ }, { "cell_type": "markdown", - "id": "f5a00d18", + "id": "93d8901e", "metadata": { "editable": true }, @@ -2778,13 +2772,10 @@ { "cell_type": "code", "execution_count": 3, - "id": "68f97538", + "id": "6a775d3c", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, "outputs": [], "source": [ @@ -2794,7 +2785,7 @@ }, { "cell_type": "markdown", - "id": "a7fbe32f", + "id": "b8360996", "metadata": { "editable": true }, @@ -2805,7 +2796,7 @@ }, { "cell_type": "markdown", - "id": "1b64af25", + "id": "0b4a5c74", "metadata": { "editable": true }, @@ -2817,7 +2808,7 @@ }, { "cell_type": "markdown", - "id": "ef56e132", + "id": "f27ef437", "metadata": { "editable": true }, @@ -2827,7 +2818,7 @@ }, { "cell_type": "markdown", - "id": "6d7f0c20", + "id": "6a7d8179", "metadata": { "editable": true }, @@ -2839,7 +2830,7 @@ }, { "cell_type": "markdown", - "id": "3ac315d2", + "id": "24b3bcb3", "metadata": { "editable": true }, @@ -2853,7 +2844,7 @@ }, { "cell_type": "markdown", - "id": "040d030b", + "id": "196152f9", "metadata": { "editable": true }, @@ -2869,7 +2860,7 @@ }, { "cell_type": "markdown", - "id": "1cb9c213", + "id": "6b935471", "metadata": { "editable": true }, @@ -2879,7 +2870,7 @@ }, { "cell_type": "markdown", - "id": "7f6ab192", + "id": "d5261a7f", "metadata": { "editable": true }, @@ -2891,7 +2882,7 @@ }, { "cell_type": "markdown", - "id": "bc154729", + "id": "398173a2", "metadata": { "editable": true }, @@ -2901,7 +2892,7 @@ }, { "cell_type": "markdown", - "id": "cda14c18", + "id": "0f29a1a0", "metadata": { "editable": true }, @@ -2913,7 +2904,7 @@ }, { "cell_type": "markdown", - "id": "ffc6db98", + "id": "22f27a92", "metadata": { "editable": true }, @@ -2927,7 +2918,7 @@ }, { "cell_type": "markdown", - "id": "f5dd4f8d", + "id": "a2b8898e", "metadata": { "editable": true }, @@ -2937,7 +2928,7 @@ }, { "cell_type": "markdown", - "id": "54cf8a09", + "id": "42b415d8", "metadata": { "editable": true }, @@ -2948,7 +2939,7 @@ }, { "cell_type": "markdown", - "id": "c06fcb28", + "id": "b522b609", "metadata": { "editable": true }, @@ -2963,7 +2954,7 @@ }, { "cell_type": "markdown", - "id": "16b2e122", + "id": "2e2e2e39", "metadata": { "editable": true }, @@ -2973,7 +2964,7 @@ }, { "cell_type": "markdown", - "id": "9e48ac99", + "id": "6f14f45f", "metadata": { "editable": true }, @@ -2985,7 +2976,7 @@ }, { "cell_type": "markdown", - "id": "9a536e9c", + "id": "d9210eed", "metadata": { "editable": true }, @@ -2997,7 +2988,7 @@ }, { "cell_type": "markdown", - "id": "e9afa223", + "id": "5050ec60", "metadata": { "editable": true }, @@ -3012,7 +3003,7 @@ }, { "cell_type": "markdown", - "id": "f4f76d91", + "id": "04ac7d83", "metadata": { "editable": true }, @@ -3024,38 +3015,13 @@ }, { "cell_type": "code", - "execution_count": 18, - "id": "801ec4de", + "execution_count": 4, + "id": "6b2e19f6", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Eigenvalues of Hessian Matrix:[0.29828983 4.4698111 ]\n", - "[[4.]\n", - " [3.]]\n", - "[[4.]\n", - " [3.]]\n" - ] - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkMAA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ayjp16qTatWs73/v7++uWW27Rzp07tW/fPrf3vHPnTv3888+6/fbbnWV2vG644QYdOHBA27dvL/DnBpQnwhDwt6ioKIWGhrr9wzd//nxt3rxZy5cvd3tslSpV8o3wysnJUZcuXZSSkqJHH31Un332mf73v//pyy+/lCSdPn1aknTs2DHl5OSoTp06+c7rbltev//+u7799luXsBYYGKiwsDAZY/L1T4qMjMx3juDgYGd5iuvo0aMey5p32++//64///xTQUFB+cp78OBBZ1kTEhL06aefqlatWho6dKgSEhKUkJCgyZMnO891+PBhRUdHy8/P8/+N/f777zLGqHbt2vmu9+WXX5b5z8ZRhvfffz/f9Zs2bSpJ+cpw++23KygoSJmZmc6+W7mNHDlSTz75pHr16qX3339fmzZt0ubNm9WiRQu35YyIiHB57+gL52n7X3/95bK9oO/V8d27u2dJevjhh/Pd95AhQ9zeN+BNjCYD/ubv76+OHTtq5cqVOnDggOrWrev8rEmTJpKk3bt3uz0271xAkvT999/rm2++0ezZszVgwADn9p07d7rsV6NGDdlsNh08eDDfOdxty8sR4mbOnOnx87LkCBBFKX9UVJQiIyP18ccfuz1X7hqrtm3bqm3btsrOztaWLVv06quvavjw4apdu7b69eunmjVrasOGDcrJyfEYiKKiomSz2bR+/XoFBwfn+9zdttIWFRWl5s2ba/z48W4/z90ZPzs7W7fffrtq1Kih4OBg3XXXXfrvf//r0pl/7ty5uvPOOzVhwgSX8xw5cqRMpkEo6Ht1Fx6lc79zo0ePVp8+fdzu06hRo1IqIXD+CENALqNHj9ZHH32k++67T++9954CAwNLfC5HQMr7B3f69Oku76tWraorrrhCKSkpeuGFF5xNZcePH9f7779f6HV69OihCRMmKDIyUvHx8SUub26OMhelRqRRo0aqW7euFixYoJEjRzrve8+ePdq4caPLH/sePXpo4cKFys7OVuvWrYtUFn9/f7Vu3VqJiYmaN2+etm7dqn79+qlbt25asGCBZs+e7bGprEePHnruueeUlpamvn37Ful6hSnOz8ZRhg8//FAJCQmqUaNGgfs+9dRTWr9+vVauXKmqVavq2muv1S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B5d18QAAQCXg9TB04sQJ7dy50/l+165d+vrrrxUREaG4uDhFRka67B8YGKg6deqoUaNG5V1UAABQCXk9DG3ZskUdOnRwvh85cqQkacCAAZo9e7aXSgUAAKzC62Goffv2MsYUef/du3eXXWEAAIDlVOgO1AAAAGWNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACzN62Ho888/V1JSkqKjo2Wz2bR06VLnZ2fPntVjjz2miy++WFWrVlV0dLTuvPNO7d+/33sFBgAAlYrXw9DJkyfVokULTZkyJd9np06d0tatW/Xkk09q69atSklJ0S+//KJ//vOfXigpAACojGzGGOPtQjjYbDYtWbJEvXr18rjP5s2bdcUVV2jPnj2Ki4sr0nkzMjIUHh6u9PR0Va9evZRKCwAAylJ5/f0OKLMzl5H09HTZbDZdcMEFHvfJzMxUZmam831GRkY5lAwAAPgirzeTFcdff/2lxx9/XLfddluBCTE5OVnh4eHOV2xsbDmWEgAA+BKfCUNnz55Vv379lJOTo6lTpxa47+jRo5Wenu58paamllMpAQCAr/GJZrKzZ8+qb9++2rVrl1avXl1ou2FwcLCCg4PLqXQAAMCXVfgw5AhCO3bs0Jo1axQZGentIgEAgErE62HoxIkT2rlzp/P9rl279PXXXysiIkLR0dG66aabtHXrVq1YsULZ2dk6ePCgJCkiIkJBQUHeKjYAAKgkvD60fu3aterQoUO+7QMGDNDYsWMVHx/v9rg1a9aoffv2RboGQ+sBAPA9lhla3759exWUxyrQNEgAAKAS8pnRZAAAAGWBMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQAACyNMAQA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gAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKURhgAAgKVV+DCUnJysyy+/XGFhYapVq5Z69eql7du3e7tYAACgkqjwYWjdunUaOnSovvzyS61atUpZWVnq0qWLTp486e2iAQCASsBmjDHeLkRxHD58WLVq1dK6det07bXXFumYjIwMhYeHKz09XdWrVy/jEgIAgNJQXn+/A8rszGUkPT1dkhQREeFxn8zMTGVmZjrfZ2RklHm5AACAb6rwzWS5GWM0cuRIXXPNNWrWrJnH/ZKTkxUeHu58xcbGlmMpAQCAL/GpZrKhQ4fqgw8+0IYNGxQTE+NxP3c1Q7GxsTSTAQDgQ2gmy+PBBx/U8uXL9fnnnxcYhCQpODhYwcHB5VQyAADgyyp8GDLG6MEHH9SSJUu0du1axcfHe7tIAACgEqnwYWjo0KGaP3++li1bprCwMB08eFCSFB4ertDQUC+XDgAA+LoK32fIZrO53T5r1iwNHDiwSOdgaD0AAL6HPkN/q+BZDQAA+DifGloPAABQ2ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0ghDAADA0nwmDE2dOlXx8fEKCQlRq1attH79em8XCQAAVAI+EYbeeecdDR8+XGPGjNG2bdvUtm1bdevWTXv37vV20QAAgI+zGWOMtwtRmNatW+vSSy/V66+/7tzWuHFj9erVS8nJyYUen5GRofDwcKWnp6t69eplWVQAAFBKyuvvd4W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V5fku7n1Xlue7uPft4OvPd3Hvu7I83+vWrdPQoUP15ZdfatWqVcrKylKXLl108uRJj8eU2zNufMwVV1xh7rvvPpdtiYmJ5vHHH3e7/6OPPmoSExNdtg0ePNhceeWVzvd9+/Y1119/vcs+Xbt2Nf369SulUp+/4t63O02aNDHjxo1zvp81a5YJDw8vrSKWieLe95o1a4wkc+zYMY/ntML3vWTJEmOz2czu3bud23zh+85NklmyZEmB+1SW5zu3oty3O774fOdWlPuuLM93biX5vivD822MMYcOHTKSzLp16zzuU17PuE/VDJ05c0ZfffWVunTp4rK9S5cu2rhxo9tjvvjii3z7d+3aVVu2bNHZs2cL3MfTOctbSe47r5ycHB0/fjzfYncnTpxQ/fr1FRMTox49euT7L0tvOp/7vuSSS1S3bl116tRJa9ascfnMCt/3W2+9peuuuy7fLO0V+fsuicrwfJcGX3y+z4cvP9+lobI83+np6ZJU4CKs5fWM+1QYOnLkiLKzs/OtVl+7du18q9o7HDx40O3+WVlZOnLkSIH7eDpneSvJfef10ksv6eTJk+rbt69zW2JiombPnq3ly5drwYIFCgkJUZs2bbRjx45SLX9JleS+69atqxkzZmjx4sVKSUlRo0aN1KlTJ33++efOfSr7933gwAF99NFHuvvuu122V/TvuyQqw/NdGnzx+S6JyvB8n6/K8nwbYzRy5Ehdc801atasmcf9yusZ95nlOHKz2Wwu740x+bYVtn/e7cU9pzeUtIwLFizQ2LFjtWzZMtWqVcu5/corr9SVV17pfN+mTRtdeumlevXVV/X//t//K72Cn6fi3HejRo3UqFEj5/urrrpKqampevHFF3XttdeW6JzeUtIyzp49WxdccIF69erlst1Xvu/iqizPd0n5+vNdHJXp+S6pyvJ8P/DAA/r222+1YcOGQvctj2fcp2qGoqKi5O/vny/tHTp0KF8qdKhTp47b/QMCAhQZGVngPp7OWd5Kct8O77zzju666y69++67uu666wrc18/PT5dffnmF+S+J87nv3K688kqXe6rM37cxRjNnzlT//v0VFBRU4L4V7fsuicrwfJ8PX36+S4uvPd/no7I83w8++KCWL1+uN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RMwTAp1166aX64YcftHLlSrVr187bxQHgg+gzBMBnffLJJ/r555+VnZ2t2rVre7s4AHwUNUMAfNLWrVvVvn17vfbaa1q4cKGqVKmiRYsWebtYAHwQfYYA+Jzdu3ere/fuevzxx9W/f381adJEl19+ub766iu1atXK28UD4GOoGQLgU/744w+1adNG1157raZPn+7c3rNnT2VmZurjjz/2YukA+CLCEAAAsDQ6UAMAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEsjDAEAAEv7/5vxx3z/T4NjAAAAAElFTkSuQmCC", - "text/plain": [ - "
    " - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "\n", "# Importing various packages\n", @@ -3070,7 +3036,7 @@ "# the number of datapoints\n", "n = 100\n", "x = 2*np.random.rand(n,1)\n", - "y = 4+3*x#+np.random.randn(n,1)\n", + "y = 4+3*x+np.random.randn(n,1)\n", "\n", "X = np.c_[np.ones((n,1)), x]\n", "# Hessian matrix\n", @@ -3107,58 +3073,7 @@ }, { "cell_type": "markdown", - "id": "b6c4900e", - "metadata": { - "editable": true - }, - "source": [ - "## And a corresponding example using **scikit-learn**" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "d2f662be", - "metadata": { - "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[4.14348082]\n", - " [2.81611054]]\n", - "[4.2245229] [2.90496902]\n" - ] - } - ], - "source": [ - "# Importing various packages\n", - "from random import random, seed\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "from sklearn.linear_model import SGDRegressor\n", - "\n", - "n = 100\n", - "x = 2*np.random.rand(n,1)\n", - "y = 4+3*x+np.random.randn(n,1)\n", - "\n", - "X = np.c_[np.ones((n,1)), x]\n", - "theta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)\n", - "print(theta_linreg)\n", - "sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)\n", - "sgdreg.fit(x,y.ravel())\n", - "print(sgdreg.intercept_, sgdreg.coef_)" - ] - }, - { - "cell_type": "markdown", - "id": "83bd5b44", + "id": "26e7815c", "metadata": { "editable": true }, @@ -3170,7 +3085,7 @@ }, { "cell_type": "markdown", - "id": "8c7ee80c", + "id": "0ae04360", "metadata": { "editable": true }, @@ -3182,7 +3097,7 @@ }, { "cell_type": "markdown", - "id": "7c70714f", + "id": "402501d6", "metadata": { "editable": true }, @@ -3192,7 +3107,7 @@ }, { "cell_type": "markdown", - "id": "e170727b", + "id": "fdd060d5", "metadata": { "editable": true }, @@ -3206,7 +3121,7 @@ }, { "cell_type": "markdown", - "id": "b7b5d1ce", + "id": "8a061527", "metadata": { "editable": true }, @@ -3216,7 +3131,7 @@ }, { "cell_type": "markdown", - "id": "7e59753a", + "id": "72c8bb88", "metadata": { "editable": true }, @@ -3228,7 +3143,7 @@ }, { "cell_type": "markdown", - "id": "d05de5f9", + "id": "a8e126ba", "metadata": { "editable": true }, @@ -3239,7 +3154,7 @@ }, { "cell_type": "markdown", - "id": "e3a5c888", + "id": "cae81a93", "metadata": { "editable": true }, @@ -3254,7 +3169,7 @@ }, { "cell_type": "markdown", - "id": "52b009a7", + "id": "646feacb", "metadata": { "editable": true }, @@ -3268,7 +3183,7 @@ }, { "cell_type": "markdown", - "id": "430d2418", + "id": "e2b0d0a9", "metadata": { "editable": true }, @@ -3278,38 +3193,13 @@ }, { "cell_type": "code", - "execution_count": 20, - "id": "b889c65e", + "execution_count": 5, + "id": "b2354adf", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Eigenvalues of Hessian Matrix:[0.34398504 4.37738976]\n", - "[[3.94418649]\n", - " [3.12329928]]\n", - "[[3.94395941]\n", - " [3.123489 ]]\n" - ] - }, - { - "data": { - "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t27AgANnW46667EBERgerqasvYrbqmTZuGp556CkOHDsVHH32Ebdu2Yfv27ejSpYvdesbGxlo9N4+Fc7T9woULVtudfa7mz97eMQPAI488YnPcDz74oN3jluP06dN2s8rMY/jq18fdDLS+ffti+/bt2Lp1K/7zn/8gKSkJDz30EDZt2uSyXoC8a+D06dNWwaVZ/W2+OoekTcwmI78JDQ1F//798dlnn6GiosLqP1JzCq15EGd99ecCAkzZMHv37sWSJUswduxYy/b9+/dblbviiisgSRKOHTtmsw972+ozB3Fvvvmmw9/7kjmAkFP/pk2bIi4uDmvXrrW7r7otVunp6UhPT4fRaMSOHTvwz3/+E7m5uWjRogVGjhyJZs2aYdOmTaitrXUYEDVt2hSSJKG0tNRuFpGzzCKlNG3aFJ07d8acOXPs/r7uYHyj0Yi77roLV1xxBQwGA+699158+eWXVoP533nnHdxzzz147rnnrPZz6tQpn0yD4OxztRc8An9852bOnIns7Gy7ZVJTU92uS1xcHCoqKmy2Hz161Op9zexdl87ExMSgR48eAIBevXqhV69e6NKlCx588EHs2bPH4ffMnWsgLi4OX331lctyvjqHpE1sGSK/mjlzJoxGI+6//35cunTJq32Z/yOuf8NdtGiR1fOGDRuiZ8+eKCoqsvqr/MyZM/joo49cvs/tt9+On3/+GXFxcejRo4fNw5MJ38x1ltMikpqailatWqGgoMBqcrqDBw9aZXWZ63r69GkYjUa7dbX3n3toaCh69eqF1157DQCwa9cuAMCgQYNw4cIFm+yb+u8nhMCRI0fsvt8111zj8vjqc+fcmOvw7bffIiUlxW4d6gZDTz/9NEpLS/Huu+9i2bJl2Lt3r03rkCRJNt+pTz75BEeOHHH7WOT44osvrLKpjEYjli1bhpSUFCQkJNh9TWpqKtq1a4e9e/faPeYePXpYBb5y3XTTTfjuu+8s3wGzt99+G5IkITMz0+19OtOuXTs8+uij+Oabb7Bs2TKH5dy5Bvr164czZ85gzZo1VtvrZ+j56hySNrFliPyqT58+eO211zB58mR069YNEyZMQMeOHRESEoKKigoUFhYCgKxJD9PS0pCSkoIZM2ZACIHY2Fh89NFHWLdunU3Zv/3tb7j11ltx8803Y/r06TAajXjhhRfQsGFD/PLLL07fJzc3F4WFhbjxxhsxdepUdO7cGbW1tTh06BA+++wzTJ8+Hb169XLrPJiDhPnz52Ps2LEIDw9Hamqq3f98Q0JC8Le//Q333Xcfhg0bhv/7v//Db7/9hlmzZtl0EYwcORLvvvsubrvtNkyZMgU9e/ZEeHg4Dh8+jOLiYmRlZWHYsGFYuHAh1q9fj8GDB6NNmza4cOGCpeVrwIABAExjLN566y3cf//92LdvHzIzM1FbW4tt27ahffv2GDlyJPr06YMJEyZg/Pjx2LFjB2688UY0bNgQFRUV2LRpE6655ho88MADbp0b86zk7777Ltq3b49GjRohPj7eKqip65lnnsG6detwww034OGHH0ZqaiouXLiAAwcOYPXq1Vi4cCESEhKwbt065OXl4amnnrJMzZCXl4dHHnkEGRkZGDZsGABTcLVkyRKkpaWhc+fO2LlzJ1588UWHgYm3mjZtiv79++Opp55Cw4YNsWDBAvzwww8u0+sXLVqEQYMG4ZZbbsG4cePQunVr/PLLL/j++++xa9cuLF++3O26TJ06FW+//TYGDx6MZ555Bm3btsUnn3yCBQsW4IEHHsDVV1/t6WE69Mgjj2DhwoWYPXs2RowYgdDQUJsy7lwDY8eOxcsvv4y7774bzz77LK666iqsWbMGn376qWVfZr44h6RRARy8TTq2Z88eMX78eJGcnCwMBoOIjIwUV111lbjnnnvEF198YVV27NixomHDhnb3891334mbb75ZREdHiyuuuELceeed4tChQwKAePrpp63Krlq1SnTu3FlERESINm3aiOeff148/fTTLrPJhDCl6z755JMiNTVVREREiJiYGHHNNdeIqVOnWmUCARCTJk2yqae9fc6cOVPEx8eLkJAQm0whe9544w3Rrl07ERERIa6++mrx5ptvirFjx1pl0ghhSleeO3eu6NKli4iMjBSNGjUSaWlpYuLEieKnn34SQpiywIYNGybatm0rDAaDiIuLE/369ROrVq2y2tfvv/8u/vrXv1reNy4uTvTv319s3rzZqtybb74pevXqJRo2bCiioqJESkqKuOeee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D5Bu+7M7i+CwiIlIQU+vJN/wx3YDaphAgIiJFMbWetM0f0w1wfBYRESmA3WTkO+zOIiIiDWDLEPkWpxsgIiKVYzBEvsfuLCIiUjF2kxEREZGuMRgiIiIiXWMwRERERLrGYIiIiIh0jcEQERER6RqDISIiItI1BkNERESkawyGiIiISNcYDBEREZGuMRgiIiIiXWMwRERERLrGYIiIiIh0jcEQERER6RqDISIiItI1BkNERESkawyGiIiISNdUHwzl5eXhuuuuQ3R0NJo3b46hQ4di3759ga4WERERBQnVB0MbNmzApEmTsHXrVqxbtw41NTUYOHAgzp07F+iqERERURCQhBAi0JVwx8mTJ9G8eXNs2LABN954o6zXVFVVISYmBpWVlWjcuLGPa0hERERK8Nf9O8xne/aRyspKAEBsbKzDMtXV1aiurrY8r6qq8nm9iIiISJtU301WlxAC06ZNQ9++fdGpUyeH5fLy8hATE2N5JCYm+rGWREREpCWa6iabNGkSPvnkE2zatAkJCQkOy9lrGUpMTGQ3GRERkYawm6yeyZMnY9WqVdi4caPTQAgADAYDDAaDn2pGREREWqb6YEgIgcmTJ2PlypUoKSlBcnJyoKtEREREQUT1wdCkSZOQn5+PDz/8ENHR0Th27BgAICYmBlFRUQGuHREREWmd6scMSZJkd/tbb72FcePGydoHU+uJiIi0h2OGLlN5rEZEREQap6nUeiIiIiKlMRgiIiIiXWMwRERERLrGYIiIiIh0jcEQERER6RqDISIiItI1BkNERESkawyGiIiISNcYDBEREZGuMRgiIiIiXWMwRERERLrGYIiIiIh0jcEQERER6RqDISIiItI1BkNERESkawyGiIiISNcYDBEREZGuMRgiIiIiXWMwRERERLrGYIiIiIh0jcEQERER6RqDISIiItI1BkNERESkawyGiIiISNcYDBEREZGuMRgiIiIiXWMwRERERLrGYIiIiIh0jcEQERER6RqDISIiItI1BkNERESkawyGiIiISNcYDBEREZGuMRgiIiIiXWMwRERERLrGYIiIiIh0jcEQERER6RqDISIiItI1zQRDCxYsQHJyMiIjI9G9e3eUlpYGukpEREQUBDQRDC1btgy5ub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tVa5x48aoqKiwekRGRvrjkGRx97jN9u3bZ3VM7dq1s/wuGD/v+fPnWx1veXk5YmNjceedd1qVU/vnfe7cOXTp0gWvvvqqrPLBcn27e9zBcn27e9xmWr++3T3uYLm+N2zYgEmTJmHr1q1Yt24dampqMHDgQJw7d87ha/x2jQuN6dmzp7j//vuttqWlpYkZM2bYLf/oo4+KtLQ0q20TJ04UvXv3tjwfMWKEuPXWW63K3HLLLWLkyJEK1dp77h63PR06dBCzZ8+2PH/rrbdETEyMUlX0CXePu7i4WAAQv/76q8N96uHzXrlypZAkSRw4cMCyTQufd10AxMqVK52WCZbruy45x22PFq/vuuQcd7Bc33V58nkHw/UthBAnTpwQAMSGDRsclvHXNa6plqGLFy9i586dGDhwoNX2gQMHYvPmzXZfs2XLFpvyt9xyC3bs2IFLly45LeNon/7myXHXV1tbizNnztgsdnf27Fm0bdsWCQkJuP32223+sgwkb4772muvRatWrXDTTTehuLjY6nd6+Lz//e9/Y8CAATaztKv58/ZEMFzfStDi9e0NLV/fSgiW67uyshIAnC7C6q9rXFPB0KlTp2A0Gm1Wq2/RooXNqvZmx44ds1u+pqYGp06dclrG0T79zZPjru+ll17CuXPnMGLECMu2tLQ0LFmyBKtWrUJBQQEiIyPRp08f/PTTT4rW31OeHHerVq2wePFiFBYWoqioCKmpqbjpppuwceNGS5lg/7wrKiqwZs0a3HfffVbb1f55eyIYrm8laPH69kQwXN/eCpbrWwiBadOmoW/fvujUqZPDcv66xjWzHEddkiRZPRdC2GxzVb7+dnf3GQie1rGgoACzZs3Chx9+iObNm1u29+7dG71797Y879OnD7p164Z//vOf+Mc//qFcxb3kznGnpqYiNTXV8vz6669HeXk55s6dixtvvNGjfQaKp3VcsmQJmjRpgqFDh1pt18rn7a5gub49pfXr2x3BdH17Kliu74ceeghff/01Nm3a5LKsP65xTbUMNW3aFKGhoTbR3okTJ2yiQrOWLVvaLR8WFoa4uDinZRzt0988OW6zZcuW4d5778X777+PAQMGOC0bEhKC6667TjV/SXhz3HX17t3b6piC+fMWQuDNN9/EmDFjEBER4bSs2j5vTwTD9e0NLV/fStHa9e2NYLm+J0+ejFWrVqG4uBgJCQlOy/rrGtdUMBQREYHu3btj3bp1VtvXrVuHG264we5rrr/+epvyn332GXr06IHw8HCnZRzt0988OW7A9BfjuHHjkJ+fj8GDB7t8HyEE9uzZg1atWnldZyV4etz17d692+qYgvXzBkzZGvv378e9997r8n3U9nl7Ihiub09p/fpWitaub29o/foWQuChhx5CUVER1q9fj+TkZJev8ds1LnuotUq89957Ijw8XPz73/8W3333ncjNzRUNGza0jKqfMWOGGDNmjKX8//73P9GgQQMxdepU8d1334l///vfIjw8XKxYscJS5ssvvxShoaHi+eefF99//714/vnnRVhYmNi6davfj88Rd487Pz9fhIWFiddee01UVFRYHr/99pulzKxZs8TatWvFzz//LHbv3i3Gjx8vwsLCxLZt2/x+fI64e9wvv/yyWLlypfjxxx/Ft99+K2bMmCEAiMLCQkuZYPy8ze6++27Rq1cvu/vUwud95swZsXv3brF7924BQMybN0/s3r1bHDx4UAgRvNe3u8cdLNe3u8cdLNe3u8dtpvXr+4EHHhAxMTGipKTE6nt7/vx5S5lAXeOaC4aEEOK1114Tbdu2FREREaJbt25WaXljx44V/fr1sypfUlIirr32WhERESGSkpLEv/71L5t9Ll++XKSmporw8HCRlpZmdXGphTvH3a9fPwHA5jF27FhLmdzcXNGmTRsREREhmjVrJgYOHCg2b97sxyOSx53jfuGFF0RKSoqIjIwUV1xxhejbt6/45JNPbPYZbJ+3EEL89ttvIioqSixevNju/rTweZtTpx19b4P1+nb3uIPl+nb3uIPl+vbkex4M17e9YwYg3nrrLUuZQF3j0uUKEhEREemSpsYMERERESmNwRARERHpGoMhIiIi0jUGQ0RERKRrDIaIiIhI1xgMERERka4xGCIiIiJdYzBEREREusZgiIiIiHSNwRARERHpGoMhItKkgoICREZG4siRI5Zt9913Hzp37ozKysoA1oyItIZrkxGRJgkh0LVrV6Snp+PVV1/F7Nmz8cYbb2Dr1q1o3bp1oKtHRBoSFugKEBF5QpIkzJkzBzk5OYiPj8f8+fNRWlrKQIiI3MaWISLStG7duuG///0vPvvsM/Tr1y/Q1SEiDeKYISLSrE8//RQ//PADjEYjWrRoEejqEJFGsWWIiDRp165dyMjIwGuvvYb33nsPDRo0wPLlywNdLSLSII4ZIiLNOXDgAAYPHowZM2ZgzJgx6NChA6677jrs3LkT3bt3D3T1iEhj2DJERJryyy+/oE+fPrjxxhuxaNEiy/asrCxUV1dj7dq1AawdEWkRgyEiIiLSNQ6gJiIiIl1jMERERES6xmCIiIiIdI3BEBEREekagyEiIiLSNQZDREREpGsMhoiIiEjXGAwRERGRrjEYIiIiIl1jMERERES6xmCIiIiIdI3BEBEREena/wPCAdOrbUuQbgAAAABJRU5ErkJggg==", - "text/plain": [ - "
    " - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "from random import random, seed\n", "import numpy as np\n", @@ -3365,7 +3255,7 @@ }, { "cell_type": "markdown", - "id": "21e20510", + "id": "e95bd522", "metadata": { "editable": true }, @@ -3387,7 +3277,7 @@ }, { "cell_type": "markdown", - "id": "59d61c18", + "id": "947549ab", "metadata": { "editable": true }, @@ -3399,7 +3289,7 @@ }, { "cell_type": "markdown", - "id": "19a3af8f", + "id": "64b3eeb6", "metadata": { "editable": true }, @@ -3411,7 +3301,7 @@ }, { "cell_type": "markdown", - "id": "a0a91546", + "id": "8ddf1823", "metadata": { "editable": true }, @@ -3423,7 +3313,7 @@ }, { "cell_type": "markdown", - "id": "4ddc3a0d", + "id": "fe9d8eab", "metadata": { "editable": true }, @@ -3433,7 +3323,7 @@ }, { "cell_type": "markdown", - "id": "2c51cc5b", + "id": "a6171f9f", "metadata": { "editable": true }, @@ -3445,7 +3335,7 @@ }, { "cell_type": "markdown", - "id": "754dd1c2", + "id": "7fed4d62", "metadata": { "editable": true }, @@ -3455,7 +3345,7 @@ }, { "cell_type": "markdown", - "id": "37b8fcf8", + "id": "276ab416", "metadata": { "editable": true }, @@ -3472,7 +3362,7 @@ }, { "cell_type": "markdown", - "id": "4103d318", + "id": "67074db1", "metadata": { "editable": true }, @@ -3482,7 +3372,7 @@ }, { "cell_type": "markdown", - "id": "dae6c763", + "id": "068b0864", "metadata": { "editable": true }, @@ -3494,7 +3384,7 @@ }, { "cell_type": "markdown", - "id": "b13a4b0d", + "id": "20210169", "metadata": { "editable": true }, @@ -3504,7 +3394,7 @@ }, { "cell_type": "markdown", - "id": "0911661b", + "id": "4a45a715", "metadata": { "editable": true }, @@ -3516,7 +3406,7 @@ }, { "cell_type": "markdown", - "id": "9a4144ae", + "id": "ac682db5", "metadata": { "editable": true }, @@ -3530,7 +3420,7 @@ }, { "cell_type": "markdown", - "id": "9dfc5f86", + "id": "fe40344c", "metadata": { "editable": true }, @@ -3542,7 +3432,7 @@ }, { "cell_type": "markdown", - "id": "73be1c56", + "id": "4f23bc28", "metadata": { "editable": true }, @@ -3561,7 +3451,7 @@ }, { "cell_type": "markdown", - "id": "9bd87051", + "id": "587b3612", "metadata": { "editable": true }, @@ -3574,7 +3464,7 @@ }, { "cell_type": "markdown", - "id": "c720ad2b", + "id": "5b99abf5", "metadata": { "editable": true }, @@ -3586,7 +3476,7 @@ }, { "cell_type": "markdown", - "id": "2bb60a91", + "id": "5bf144d8", "metadata": { "editable": true }, @@ -3596,7 +3486,7 @@ }, { "cell_type": "markdown", - "id": "3a65ac27", + "id": "cd14d016", "metadata": { "editable": true }, @@ -3609,7 +3499,7 @@ }, { "cell_type": "markdown", - "id": "3dfeab84", + "id": "3d7e4869", "metadata": { "editable": true }, @@ -3619,7 +3509,7 @@ }, { "cell_type": "markdown", - "id": "6e8ad46c", + "id": "3fbcb18f", "metadata": { "editable": true }, @@ -3631,7 +3521,7 @@ }, { "cell_type": "markdown", - "id": "500a62cd", + "id": "ba1bd0a8", "metadata": { "editable": true }, @@ -3646,7 +3536,7 @@ }, { "cell_type": "markdown", - "id": "edf77f5d", + "id": "52f96491", "metadata": { "editable": true }, @@ -3659,7 +3549,7 @@ }, { "cell_type": "markdown", - "id": "9d308fc9", + "id": "5cd4001c", "metadata": { "editable": true }, @@ -3673,7 +3563,7 @@ }, { "cell_type": "markdown", - "id": "fccb6caa", + "id": "d1ac4860", "metadata": { "editable": true }, @@ -3685,7 +3575,7 @@ }, { "cell_type": "markdown", - "id": "f1fa209f", + "id": "73822d93", "metadata": { "editable": true }, @@ -3695,7 +3585,7 @@ }, { "cell_type": "markdown", - "id": "4ae99f60", + "id": "678b5041", "metadata": { "editable": true }, @@ -3708,7 +3598,7 @@ }, { "cell_type": "markdown", - "id": "36cbbd77", + "id": "cdb9b585", "metadata": { "editable": true }, @@ -3720,7 +3610,7 @@ }, { "cell_type": "markdown", - "id": "d2d67dee", + "id": "decbfc68", "metadata": { "editable": true }, @@ -3732,7 +3622,7 @@ }, { "cell_type": "markdown", - "id": "c1e84f6b", + "id": "27d418d8", "metadata": { "editable": true }, @@ -3744,7 +3634,7 @@ }, { "cell_type": "markdown", - "id": "d0806a88", + "id": "c59d8340", "metadata": { "editable": true }, @@ -3756,7 +3646,7 @@ }, { "cell_type": "markdown", - "id": "5217eb80", + "id": "1f9d8ae6", "metadata": { "editable": true }, @@ -3770,7 +3660,7 @@ }, { "cell_type": "markdown", - "id": "26476c82", + "id": "eb92751f", "metadata": { "editable": true }, @@ -3782,7 +3672,7 @@ }, { "cell_type": "markdown", - "id": "865ed23a", + "id": "c8924cc6", "metadata": { "editable": true }, @@ -3792,7 +3682,7 @@ }, { "cell_type": "markdown", - "id": "267f405a", + "id": "b859ce0a", "metadata": { "editable": true }, @@ -3804,7 +3694,7 @@ }, { "cell_type": "markdown", - "id": "128c8fe1", + "id": "51db1890", "metadata": { "editable": true }, @@ -3814,7 +3704,7 @@ }, { "cell_type": "markdown", - "id": "025774a5", + "id": "96b9eb8a", "metadata": { "editable": true }, @@ -3826,7 +3716,7 @@ }, { "cell_type": "markdown", - "id": "a3d2ecae", + "id": "2e183c0f", "metadata": { "editable": true }, @@ -3838,7 +3728,7 @@ }, { "cell_type": "markdown", - "id": "7f619bb0", + "id": "45613b55", "metadata": { "editable": true }, @@ -3848,7 +3738,7 @@ }, { "cell_type": "markdown", - "id": "fa1c8647", + "id": "6e6ba17e", "metadata": { "editable": true }, @@ -3859,7 +3749,7 @@ }, { "cell_type": "markdown", - "id": "9f5a4138", + "id": "984b9f74", "metadata": { "editable": true }, @@ -3871,7 +3761,7 @@ }, { "cell_type": "markdown", - "id": "357000de", + "id": "cf9858ef", "metadata": { "editable": true }, @@ -3887,7 +3777,7 @@ }, { "cell_type": "markdown", - "id": "2716f2d3", + "id": "7240aa01", "metadata": { "editable": true }, @@ -3900,7 +3790,7 @@ }, { "cell_type": "markdown", - "id": "9f1150a1", + "id": "08167266", "metadata": { "editable": true }, @@ -3912,7 +3802,7 @@ }, { "cell_type": "markdown", - "id": "d5ee456d", + "id": "4a94d17e", "metadata": { "editable": true }, @@ -3922,7 +3812,7 @@ }, { "cell_type": "markdown", - "id": "50b60351", + "id": "bf4561b9", "metadata": { "editable": true }, @@ -3934,7 +3824,7 @@ }, { "cell_type": "markdown", - "id": "b349aa76", + "id": "bc19b151", "metadata": { "editable": true }, @@ -3944,7 +3834,7 @@ }, { "cell_type": "markdown", - "id": "0cf92ff7", + "id": "adbd1d84", "metadata": { "editable": true }, @@ -3956,7 +3846,7 @@ }, { "cell_type": "markdown", - "id": "63ab8407", + "id": "eb629ae2", "metadata": { "editable": true }, @@ -3968,7 +3858,7 @@ }, { "cell_type": "markdown", - "id": "c1c8b499", + "id": "e19f5e29", "metadata": { "editable": true }, @@ -3984,7 +3874,7 @@ }, { "cell_type": "markdown", - "id": "38a3cc6b", + "id": "3bc97428", "metadata": { "editable": true }, @@ -3996,7 +3886,7 @@ }, { "cell_type": "markdown", - "id": "6c9a1e21", + "id": "5955ee37", "metadata": { "editable": true }, @@ -4008,7 +3898,7 @@ }, { "cell_type": "markdown", - "id": "77cebd55", + "id": "bcc364dd", "metadata": { "editable": true }, @@ -4018,7 +3908,7 @@ }, { "cell_type": "markdown", - "id": "f3397dc1", + "id": "2ec6f51e", "metadata": { "editable": true }, @@ -4030,7 +3920,7 @@ }, { "cell_type": "markdown", - "id": "8b36e38d", + "id": "0d497cde", "metadata": { "editable": true }, @@ -4040,7 +3930,7 @@ }, { "cell_type": "markdown", - "id": "1c6262cc", + "id": "26fea14b", "metadata": { "editable": true }, @@ -4052,7 +3942,7 @@ }, { "cell_type": "markdown", - "id": "18a58f70", + "id": "5a26f674", "metadata": { "editable": true }, @@ -4069,7 +3959,7 @@ }, { "cell_type": "markdown", - "id": "bdadc0f1", + "id": "0e4d2ab0", "metadata": { "editable": true }, @@ -4081,7 +3971,7 @@ }, { "cell_type": "markdown", - "id": "a482e79b", + "id": "953d2d2d", "metadata": { "editable": true }, @@ -4093,7 +3983,7 @@ }, { "cell_type": "markdown", - "id": "1c1f3504", + "id": "b2a43ed6", "metadata": { "editable": true }, @@ -4103,7 +3993,7 @@ }, { "cell_type": "markdown", - "id": "c7ff16c0", + "id": "5a63ea86", "metadata": { "editable": true }, @@ -4115,7 +4005,7 @@ }, { "cell_type": "markdown", - "id": "df7b2ee6", + "id": "1f7bb354", "metadata": { "editable": true }, @@ -4125,7 +4015,7 @@ }, { "cell_type": "markdown", - "id": "768d2256", + "id": "70f7bdaa", "metadata": { "editable": true }, @@ -4137,7 +4027,7 @@ }, { "cell_type": "markdown", - "id": "f0d5cbe4", + "id": "789c944f", "metadata": { "editable": true }, @@ -4147,7 +4037,7 @@ }, { "cell_type": "markdown", - "id": "5403622a", + "id": "fabf113f", "metadata": { "editable": true }, @@ -4159,7 +4049,7 @@ }, { "cell_type": "markdown", - "id": "75c85a12", + "id": "52ecdca6", "metadata": { "editable": true }, @@ -4169,7 +4059,7 @@ }, { "cell_type": "markdown", - "id": "4591459d", + "id": "0a7eebc3", "metadata": { "editable": true }, @@ -4184,7 +4074,7 @@ }, { "cell_type": "markdown", - "id": "24cc16cd", + "id": "bab27602", "metadata": { "editable": true }, @@ -4196,7 +4086,7 @@ }, { "cell_type": "markdown", - "id": "86889b7d", + "id": "2a41eb77", "metadata": { "editable": true }, @@ -4206,7 +4096,7 @@ }, { "cell_type": "markdown", - "id": "965e8e09", + "id": "1d649e9b", "metadata": { "editable": true }, @@ -4218,7 +4108,7 @@ }, { "cell_type": "markdown", - "id": "5cffcb19", + "id": "2b6fbe08", "metadata": { "editable": true }, @@ -4230,7 +4120,7 @@ }, { "cell_type": "markdown", - "id": "6671e517", + "id": "3dc6dd52", "metadata": { "editable": true }, @@ -4242,7 +4132,7 @@ }, { "cell_type": "markdown", - "id": "252e152e", + "id": "bca29a61", "metadata": { "editable": true }, @@ -4252,7 +4142,7 @@ }, { "cell_type": "markdown", - "id": "26d20ede", + "id": "58cd9edd", "metadata": { "editable": true }, @@ -4264,7 +4154,7 @@ }, { "cell_type": "markdown", - "id": "c25ce321", + "id": "6aa14ea2", "metadata": { "editable": true }, @@ -4276,7 +4166,7 @@ }, { "cell_type": "markdown", - "id": "c036a923", + "id": "901815a2", "metadata": { "editable": true }, @@ -4288,7 +4178,7 @@ }, { "cell_type": "markdown", - "id": "6f10942f", + "id": "e7101eb4", "metadata": { "editable": true }, @@ -4298,7 +4188,7 @@ }, { "cell_type": "markdown", - "id": "8c175b28", + "id": "08f2c952", "metadata": { "editable": true }, @@ -4310,7 +4200,7 @@ }, { "cell_type": "markdown", - "id": "cb7d2fa1", + "id": "2364880d", "metadata": { "editable": true }, @@ -4320,7 +4210,7 @@ }, { "cell_type": "markdown", - "id": "352e9f9a", + "id": "b66a92bf", "metadata": { "editable": true }, @@ -4334,7 +4224,7 @@ }, { "cell_type": "markdown", - "id": "2d627bc4", + "id": "b88f4eed", "metadata": { "editable": true }, @@ -4344,7 +4234,7 @@ }, { "cell_type": "markdown", - "id": "e0d9b39f", + "id": "eb15fecd", "metadata": { "editable": true }, @@ -4356,7 +4246,7 @@ }, { "cell_type": "markdown", - "id": "f84e1a77", + "id": "6116ecb2", "metadata": { "editable": true }, @@ -4368,7 +4258,7 @@ }, { "cell_type": "markdown", - "id": "7845b77c", + "id": "ce3ab1f1", "metadata": { "editable": true }, @@ -4378,7 +4268,7 @@ }, { "cell_type": "markdown", - "id": "da3ca301", + "id": "fb60d251", "metadata": { "editable": true }, @@ -4390,7 +4280,7 @@ }, { "cell_type": "markdown", - "id": "ac98fa0a", + "id": "8206088f", "metadata": { "editable": true }, @@ -4400,7 +4290,7 @@ }, { "cell_type": "markdown", - "id": "26e6c40d", + "id": "458a83dc", "metadata": { "editable": true }, @@ -4412,7 +4302,7 @@ }, { "cell_type": "markdown", - "id": "aa9e70a1", + "id": "975eba5a", "metadata": { "editable": true }, @@ -4424,7 +4314,7 @@ }, { "cell_type": "markdown", - "id": "a1a46c84", + "id": "5be10b6e", "metadata": { "editable": true }, @@ -4434,7 +4324,7 @@ }, { "cell_type": "markdown", - "id": "f14d9318", + "id": "83ba42b9", "metadata": { "editable": true }, @@ -4446,7 +4336,7 @@ }, { "cell_type": "markdown", - "id": "b71a9481", + "id": "af29af81", "metadata": { "editable": true }, @@ -4456,7 +4346,7 @@ }, { "cell_type": "markdown", - "id": "57629d3b", + "id": "928670e3", "metadata": { "editable": true }, @@ -4468,7 +4358,7 @@ }, { "cell_type": "markdown", - "id": "3062396e", + "id": "52bc99df", "metadata": { "editable": true }, @@ -4480,7 +4370,7 @@ }, { "cell_type": "markdown", - "id": "2879fd54", + "id": "c4ce97d1", "metadata": { "editable": true }, @@ -4490,7 +4380,7 @@ }, { "cell_type": "markdown", - "id": "10e94837", + "id": "5cc4b855", "metadata": { "editable": true }, @@ -4502,7 +4392,7 @@ }, { "cell_type": "markdown", - "id": "d449327b", + "id": "7ef6b391", "metadata": { "editable": true }, @@ -4515,7 +4405,7 @@ }, { "cell_type": "markdown", - "id": "52e8baa1", + "id": "2b0bcf3c", "metadata": { "editable": true }, @@ -4527,7 +4417,7 @@ }, { "cell_type": "markdown", - "id": "ea867985", + "id": "12ae48d6", "metadata": { "editable": true }, @@ -4539,7 +4429,7 @@ }, { "cell_type": "markdown", - "id": "864b48cf", + "id": "ee553c21", "metadata": { "editable": true }, @@ -4551,7 +4441,7 @@ }, { "cell_type": "markdown", - "id": "7f7ed5ba", + "id": "c9e48708", "metadata": { "editable": true }, @@ -4561,7 +4451,7 @@ }, { "cell_type": "markdown", - "id": "d607e924", + "id": "ff8584b1", "metadata": { "editable": true }, @@ -4573,7 +4463,7 @@ }, { "cell_type": "markdown", - "id": "3bd4f95f", + "id": "fe9c5ce2", "metadata": { "editable": true }, @@ -4583,7 +4473,7 @@ }, { "cell_type": "markdown", - "id": "f8940052", + "id": "d13b4d09", "metadata": { "editable": true }, @@ -4595,7 +4485,7 @@ }, { "cell_type": "markdown", - "id": "81bbbb0e", + "id": "22960198", "metadata": { "editable": true }, @@ -4605,7 +4495,7 @@ }, { "cell_type": "markdown", - "id": "ca83ff01", + "id": "5d949f02", "metadata": { "editable": true }, @@ -4617,7 +4507,7 @@ }, { "cell_type": "markdown", - "id": "0b5ac9e9", + "id": "59be0f8c", "metadata": { "editable": true }, @@ -4627,7 +4517,7 @@ }, { "cell_type": "markdown", - "id": "19ab9b33", + "id": "1e85b855", "metadata": { "editable": true }, @@ -4640,7 +4530,7 @@ }, { "cell_type": "markdown", - "id": "59135778", + "id": "117c5f1d", "metadata": { "editable": true }, @@ -4652,7 +4542,7 @@ }, { "cell_type": "markdown", - "id": "8d40d8ab", + "id": "d3842015", "metadata": { "editable": true }, @@ -4664,7 +4554,7 @@ }, { "cell_type": "markdown", - "id": "9c0401f9", + "id": "5619e7d3", "metadata": { "editable": true }, @@ -4674,7 +4564,7 @@ }, { "cell_type": "markdown", - "id": "aa075ce0", + "id": "e091b536", "metadata": { "editable": true }, @@ -4686,7 +4576,7 @@ }, { "cell_type": "markdown", - "id": "4e465dee", + "id": "924ee170", "metadata": { "editable": true }, @@ -4703,7 +4593,7 @@ }, { "cell_type": "markdown", - "id": "7af63418", + "id": "49434aeb", "metadata": { "editable": true }, @@ -4715,7 +4605,7 @@ }, { "cell_type": "markdown", - "id": "0fff0234", + "id": "4b7e1e31", "metadata": { "editable": true }, @@ -4727,7 +4617,7 @@ }, { "cell_type": "markdown", - "id": "32328a87", + "id": "374578e8", "metadata": { "editable": true }, @@ -4737,7 +4627,7 @@ }, { "cell_type": "markdown", - "id": "6b6403d7", + "id": "5e76c1eb", "metadata": { "editable": true }, @@ -4749,7 +4639,7 @@ }, { "cell_type": "markdown", - "id": "8823b897", + "id": "ece41e8c", "metadata": { "editable": true }, @@ -4759,7 +4649,7 @@ }, { "cell_type": "markdown", - "id": "319984ba", + "id": "28ef4cad", "metadata": { "editable": true }, @@ -4771,7 +4661,7 @@ }, { "cell_type": "markdown", - "id": "2382a622", + "id": "0c826f0e", "metadata": { "editable": true }, @@ -4781,7 +4671,7 @@ }, { "cell_type": "markdown", - "id": "24b75d16", + "id": "9ef53895", "metadata": { "editable": true }, @@ -4793,7 +4683,7 @@ }, { "cell_type": "markdown", - "id": "4ba2f29c", + "id": "91cd7b4f", "metadata": { "editable": true }, @@ -4803,7 +4693,7 @@ }, { "cell_type": "markdown", - "id": "dd65fa2e", + "id": "fedfb550", "metadata": { "editable": true }, @@ -4817,14 +4707,11 @@ }, { "cell_type": "code", - "execution_count": 7, - "id": "6f044cbb", + "execution_count": 6, + "id": "1d8e47a3", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, "outputs": [], "source": [ @@ -4881,7 +4768,7 @@ }, { "cell_type": "markdown", - "id": "d69f7030", + "id": "b88f84eb", "metadata": { "editable": true }, @@ -4891,7 +4778,7 @@ }, { "cell_type": "markdown", - "id": "a8f9315a", + "id": "b0c77f0b", "metadata": { "editable": true }, @@ -4901,14 +4788,11 @@ }, { "cell_type": "code", - "execution_count": 8, - "id": "041fe053", + "execution_count": 7, + "id": "570be9c4", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, "outputs": [], "source": [ @@ -4972,7 +4856,7 @@ }, { "cell_type": "markdown", - "id": "47db85e5", + "id": "3e4210bb", "metadata": { "editable": true }, @@ -4982,14 +4866,11 @@ }, { "cell_type": "code", - "execution_count": 9, - "id": "400b4a2a", + "execution_count": 8, + "id": "b4ad5452", "metadata": { "collapsed": false, - "editable": true, - "jupyter": { - "outputs_hidden": false - } + "editable": true }, "outputs": [], "source": [ @@ -5074,25 +4955,7 @@ ] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.15" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 } diff --git a/doc/src/week36/week36.do.txt b/doc/src/week36/week36.do.txt index 8a08f81e4..f98a6b72e 100644 --- a/doc/src/week36/week36.do.txt +++ b/doc/src/week36/week36.do.txt @@ -1555,159 +1555,6 @@ plt.show() !ec -!split -===== Ridge regression and a new Synthetic Dataset ===== - - -We create a synthetic linear regression dataset with a sparse -underlying relationship. This means we have many features but only a -few of them actually contribute to the target. In our example, we’ll -use 10 features with only 3 non-zero weights in the true model. This -way, the target is generated as a linear combination of a few features -(with known coefficients) plus some random noise. The steps we include are: - -Decide on the number of samples and features (e.g. 100 samples, 10 features). -Define the _true_ coefficient vector with mostly zeros (for sparsity). For example, we set $\hat{\bm{\theta}} = [5.0, -3.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0]$, meaning only features 0, 1, and 6 have a real effect on y. - -Then we sample feature values for $\bm{X}$ randomly (e.g. from a normal distribution). We use a normal distribution so features are roughly centered around 0. -Then we compute the target values $y$ using the linear combination $\bm{X}\hat{\bm{\theta}}$ and add some noise (to simulate measurement error or unexplained variance). - - -Below is the code to generate the dataset: -!bc pycod -import numpy as np - -# Set random seed for reproducibility -np.random.seed(0) - -# Define dataset size -n_samples = 100 -n_features = 10 - -# Define true coefficients (sparse linear relationship) -theta_true = np.array([5.0, -3.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0]) - -# Generate feature matrix X (n_samples x n_features) with random values -X = np.random.randn(n_samples, n_features) # standard normal distribution - -# Generate target values y with a linear combination of X and theta_true, plus noise -noise = 0.5 * np.random.randn(n_samples) # Gaussian noise -y = X.dot @ theta_true + noise -!ec - -This code produces a dataset where only features 0, 1, and 6 -significantly influence y. The rest of the features have zero true -coefficient, so they only contribute noise. For example, feature 0 has -a true weight of 5.0, feature 1 has -3.0, and feature 6 has 2.0, so -the expected relationship is: -!bt -\[ -y \approx 5 \times X_0 \;-\; 3 \times X_1 \;+\; 2 \times X_6 \;+\; \text{noise}. -\] -!et - - - -Before fitting a regression model, it’s good practice to normalize or -standardize the features. This ensures all features are on a -comparable scale, which is especially important when using -regularization. Here we will perform standardization, scaling each -feature to have mean 0 and standard deviation 1: - -Compute the mean and standard deviation of each column (feature) in $bm{X}X. -Subtract the mean and divide by the standard deviation for each feature. - - -We also center the target $\bm{y}$ to mean $0$. Centering $\bm{y}$ (and each feature) means the model won’t require a separate intercept term – the data is shifted such that the intercept is effectively 0 . (In practice, one could include an intercept in the model and not penalize it, but here we simplify by centering.) - -!bc pyco -# Standardize features (zero mean, unit variance for each feature) -X_mean = X.mean(axis=0) -X_std = X.std(axis=0) -X_std[X_std == 0] = 1 # safeguard to avoid division by zero for constant features -X_norm = (X - X_mean) / X_std - -# Center the target to zero mean (optional, to simplify intercept handling) -y_mean = y.mean() -y_centered = y - y_mean -!ec - -After this preprocessing, each column of $\bm{X}_norm$ has mean zero and standard deviation $1$ -and $\bm{y}_centered$ has mean 0. This makes the optimization landscape -nicer and ensures the regularization penalty $\lambda \sum_j -\beta_j^2$ treats each coefficient fairly (since features are on the -same scale). - -!bc pycod -# Set regularization parameter -lam = 1.0 - -# Closed-form Ridge solution: w = (X^T X + lam * I)^{-1} X^T y -I = np.eye(n_features) -w_closed_form = np.linalg.inv(X_norm.T.dot(X_norm) + lam * I).dot(X_norm.T).dot(y_centered) - -print("Closed-form Ridge coefficients:", w_closed_form) -!ec - -This computes the ridge regression coefficients directly. The identity -matrix $I$ has the same size as $X^T X$ (which is n_features x -n_features), and lam * I adds $\lambda$ to the diagonal of $X^T X. We -then invert this matrix and multiply by $X^T y. The result -for $\bm{\theta}$ is a NumPy array of shape (n_features,) containing the -fitted weights. - - - -Alternatively, we can fit the ridge regression model using gradient descent. This is useful to visualize the iterative convergence and is necessary if $n$ and $p$ are so large that the closed-form might be too slow or memory-intensive. We derive the gradients from the cost function defined above. The gradient of the ridge cost with respect to the weight vector $w$ is: - - - -Below is the code for gradient descent implementation of ridge: -!bc pycod -# Gradient descent parameters -alpha = 0.1 -num_iters = 1000 - -# Initialize weights for gradient descent -theta = np.zeros(n_features) - -# Arrays to store history for plotting -cost_history = np.zeros(num_iters) - -# Gradient descent loop -m = n_samples # number of examples -for t in range(num_iters): - # Compute prediction error - error = X_norm.dot(theta) - y_centered # shape (m,) - # Compute cost (MSE + regularization) for monitoring - cost = (1/(2*m)) * np.dot(error, error) + (lam/(2*m)) * np.dot(theta, theta) - cost_history[t] = cost - # Compute gradient - grad = (1/m) * (X_norm.T.dot(error) + lam * theta) - # Update weights - theta = theta - alpha * grad - -# After the loop, theta contains the fitted coefficients -theta_gd = theta -print("Gradient Descent Ridge coefficients:", theta_gd) -!ec - - -Let uss confirm that the two approaches (closed-form and gradient descent) give similar results, and then evaluate the model. First, compare the learned coefficients to the true coefficients: - -!bc pycod -print("True coefficients:", theta_true) -print("Closed-form learned coefficients:", theta_closed_form) -print("Gradient descent learned coefficients:", theta_gd) - -If everything worked correctly, the learned coefficients should be -close to the true values [5.0, -3.0, 0.0, …, 2.0, …] that we used to -generate the data. Keep in mind that due to regularization and noise, -the learned values will not exactly equal the true ones, but they -should be in the same ballpark. - - - !split ===== Using gradient descent methods, limitations =====