update week 37

This commit is contained in:
Morten Hjorth-Jensen
2021-09-12 21:49:00 +02:00
parent 6ac0100ef0
commit 1bbad25d49
7 changed files with 6804 additions and 4353 deletions
+156 -69
View File
@@ -1,15 +1,15 @@
<!--
Automatically generated HTML file from DocOnce source
(https://github.com/hplgit/doconce/)
(https://github.com/doconce/doconce/)
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
<meta name="generator" content="DocOnce: https://github.com/doconce/doconce/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Week 37: Ridge and Lasso Regression">
<meta name="description" content="Week 37: Summary of Ridge and Lasso Regression and Resampling Methods">
<title>Week 37: Ridge and Lasso Regression</title>
<title>Week 37: Summary of Ridge and Lasso Regression and Resampling Methods</title>
<!-- Bootstrap style: bootstrap -->
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
@@ -41,51 +41,125 @@ Automatically generated HTML file from DocOnce source
<!-- tocinfo
{'highest level': 2,
'sections': [('Plans for week 37', 2, None, '___sec0'),
('Thursday September 10', 2, None, '___sec1'),
('A Bayesian approach to develop intuition about skrinkage '
'methods',
'sections': [('Plans for week 37', 2, None, 'plans-for-week-37'),
('Thursday September 16, Summary of Ridge and Lasso Regression '
'and start Resampling methods',
2,
None,
'___sec2'),
('The singular value decomposition', 2, None, '___sec3'),
('Linear Regression Problems', 2, None, '___sec4'),
('Fixing the singularity', 2, None, '___sec5'),
('Basic math of the SVD', 2, None, '___sec6'),
('The SVD, a Fantastic Algorithm', 2, None, '___sec7'),
('Economy-size SVD', 2, None, '___sec8'),
('Codes for the SVD', 2, None, '___sec9'),
('Mathematical Properties', 2, None, '___sec10'),
('Friday September 12', 2, None, '___sec11'),
('Ridge and LASSO Regression', 2, None, '___sec12'),
('More on Ridge Regression', 2, None, '___sec13'),
('Interpreting the Ridge results', 2, None, '___sec14'),
('More interpretations', 2, None, '___sec15'),
('A better understanding of regularization', 2, None, '___sec16'),
('Decomposing the OLS and Ridge expressions',
'thursday-september-16-summary-of-ridge-and-lasso-regression-and-start-resampling-methods'),
('Deriving OLS from a probability distribution',
2,
None,
'___sec17'),
('Introducing the Covariance and Correlation functions',
'deriving-ols-from-a-probability-distribution'),
('Independent and Identically Distrubuted (iid)',
2,
None,
'___sec18'),
('Correlation Function and Design/Feature Matrix',
'independent-and-identically-distrubuted-iid'),
('Maximum Likelihood Estimation (MLE)',
2,
None,
'___sec19'),
('Covariance Matrix Examples', 2, None, '___sec20'),
('Correlation Matrix', 2, None, '___sec21'),
('Correlation Matrix with Pandas', 2, None, '___sec22'),
('Correlation Matrix with Pandas and the Franke function',
'maximum-likelihood-estimation-mle'),
('A new Cost Function', 2, None, 'a-new-cost-function'),
("Bayes' Theorem", 2, None, 'bayes-theorem'),
("Interpretations of Bayes' Theorem",
2,
None,
'___sec23'),
('Rewriting the Covariance and/or Correlation Matrix',
'interpretations-of-bayes-theorem'),
('Test Function for what happens with OLS, Ridge and Lasso',
2,
None,
'___sec24'),
('Linking with SVD', 2, None, '___sec25')]}
'test-function-for-what-happens-with-ols-ridge-and-lasso'),
("Invoking Bayes' theorem", 2, None, 'invoking-bayes-theorem'),
('Ridge and Bayes', 2, None, 'ridge-and-bayes'),
('Lasso and Bayes', 2, None, 'lasso-and-bayes'),
('Why resampling methods', 2, None, 'why-resampling-methods'),
('Resampling methods', 2, None, 'resampling-methods'),
('Resampling approaches can be computationally expensive',
2,
None,
'resampling-approaches-can-be-computationally-expensive'),
('Why resampling methods ?', 2, None, 'why-resampling-methods'),
('Statistical analysis', 2, None, 'statistical-analysis'),
('Resampling methods', 2, None, 'resampling-methods'),
('Resampling methods: Jackknife and Bootstrap',
2,
None,
'resampling-methods-jackknife-and-bootstrap'),
('Resampling methods: Jackknife',
2,
None,
'resampling-methods-jackknife'),
('Jackknife code example', 2, None, 'jackknife-code-example'),
('Resampling methods: Bootstrap',
2,
None,
'resampling-methods-bootstrap'),
('Resampling methods: Bootstrap background',
2,
None,
'resampling-methods-bootstrap-background'),
('Resampling methods: More Bootstrap background',
2,
None,
'resampling-methods-more-bootstrap-background'),
('Resampling methods: Bootstrap approach',
2,
None,
'resampling-methods-bootstrap-approach'),
('Resampling methods: Bootstrap steps',
2,
None,
'resampling-methods-bootstrap-steps'),
('Code example for the Bootstrap method',
2,
None,
'code-example-for-the-bootstrap-method'),
('Various steps in cross-validation',
2,
None,
'various-steps-in-cross-validation'),
('How to set up the cross-validation for Ridge and/or Lasso',
2,
None,
'how-to-set-up-the-cross-validation-for-ridge-and-or-lasso'),
('Cross-validation in brief',
2,
None,
'cross-validation-in-brief'),
('Code Example for Cross-validation and $k$-fold '
'Cross-validation',
2,
None,
'code-example-for-cross-validation-and-k-fold-cross-validation'),
('The bias-variance tradeoff',
2,
None,
'the-bias-variance-tradeoff'),
('Example code for Bias-Variance tradeoff',
2,
None,
'example-code-for-bias-variance-tradeoff'),
('Understanding what happens',
2,
None,
'understanding-what-happens'),
('Summing up', 2, None, 'summing-up'),
("Another Example from Scikit-Learn's Repository",
2,
None,
'another-example-from-scikit-learn-s-repository'),
('More examples on bootstrap and cross-validation and errors',
2,
None,
'more-examples-on-bootstrap-and-cross-validation-and-errors'),
('The same example but now with cross-validation',
2,
None,
'the-same-example-but-now-with-cross-validation'),
('Cross-validation with Ridge',
2,
None,
'cross-validation-with-ridge')]}
end of tocinfo -->
<body>
@@ -115,7 +189,7 @@ MathJax.Hub.Config({
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="week37-bs.html">Week 37: Ridge and Lasso Regression</a>
<a class="navbar-brand" href="week37-bs.html">Week 37: Summary of Ridge and Lasso Regression and Resampling Methods</a>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
@@ -123,32 +197,45 @@ MathJax.Hub.Config({
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a>
<ul class="dropdown-menu">
<!-- navigation toc: --> <li><a href="._week37-bs001.html#___sec0" style="font-size: 80%;">Plans for week 37</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs002.html#___sec1" style="font-size: 80%;">Thursday September 10</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs003.html#___sec2" style="font-size: 80%;">A Bayesian approach to develop intuition about skrinkage methods</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs004.html#___sec3" style="font-size: 80%;">The singular value decomposition</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs005.html#___sec4" style="font-size: 80%;">Linear Regression Problems</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs006.html#___sec5" style="font-size: 80%;">Fixing the singularity</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs007.html#___sec6" style="font-size: 80%;">Basic math of the SVD</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs008.html#___sec7" style="font-size: 80%;">The SVD, a Fantastic Algorithm</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs009.html#___sec8" style="font-size: 80%;">Economy-size SVD</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs010.html#___sec9" style="font-size: 80%;">Codes for the SVD</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs011.html#___sec10" style="font-size: 80%;">Mathematical Properties</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs012.html#___sec11" style="font-size: 80%;">Friday September 12</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs013.html#___sec12" style="font-size: 80%;">Ridge and LASSO Regression</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs014.html#___sec13" style="font-size: 80%;">More on Ridge Regression</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs015.html#___sec14" style="font-size: 80%;">Interpreting the Ridge results</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs016.html#___sec15" style="font-size: 80%;">More interpretations</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs017.html#___sec16" style="font-size: 80%;">A better understanding of regularization</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs018.html#___sec17" style="font-size: 80%;">Decomposing the OLS and Ridge expressions</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs019.html#___sec18" style="font-size: 80%;">Introducing the Covariance and Correlation functions</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs020.html#___sec19" style="font-size: 80%;">Correlation Function and Design/Feature Matrix</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs021.html#___sec20" style="font-size: 80%;">Covariance Matrix Examples</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs022.html#___sec21" style="font-size: 80%;">Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs023.html#___sec22" style="font-size: 80%;">Correlation Matrix with Pandas</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs024.html#___sec23" style="font-size: 80%;">Correlation Matrix with Pandas and the Franke function</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs025.html#___sec24" style="font-size: 80%;">Rewriting the Covariance and/or Correlation Matrix</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs026.html#___sec25" style="font-size: 80%;">Linking with SVD</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs001.html#plans-for-week-37" style="font-size: 80%;">Plans for week 37</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs002.html#thursday-september-16-summary-of-ridge-and-lasso-regression-and-start-resampling-methods" style="font-size: 80%;">Thursday September 16, Summary of Ridge and Lasso Regression and start Resampling methods</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs003.html#deriving-ols-from-a-probability-distribution" style="font-size: 80%;">Deriving OLS from a probability distribution</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs004.html#independent-and-identically-distrubuted-iid" style="font-size: 80%;">Independent and Identically Distrubuted (iid)</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs005.html#maximum-likelihood-estimation-mle" style="font-size: 80%;">Maximum Likelihood Estimation (MLE)</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs006.html#a-new-cost-function" style="font-size: 80%;">A new Cost Function</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs007.html#bayes-theorem" style="font-size: 80%;">Bayes' Theorem</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs008.html#interpretations-of-bayes-theorem" style="font-size: 80%;">Interpretations of Bayes' Theorem</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs009.html#test-function-for-what-happens-with-ols-ridge-and-lasso" style="font-size: 80%;">Test Function for what happens with OLS, Ridge and Lasso</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs010.html#invoking-bayes-theorem" style="font-size: 80%;">Invoking Bayes' theorem</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs011.html#ridge-and-bayes" style="font-size: 80%;">Ridge and Bayes</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs012.html#lasso-and-bayes" style="font-size: 80%;">Lasso and Bayes</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs016.html#why-resampling-methods" style="font-size: 80%;">Why resampling methods</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs018.html#resampling-methods" style="font-size: 80%;">Resampling methods</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs015.html#resampling-approaches-can-be-computationally-expensive" style="font-size: 80%;">Resampling approaches can be computationally expensive</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs016.html#why-resampling-methods" style="font-size: 80%;">Why resampling methods ?</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs017.html#statistical-analysis" style="font-size: 80%;">Statistical analysis</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs018.html#resampling-methods" style="font-size: 80%;">Resampling methods</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs019.html#resampling-methods-jackknife-and-bootstrap" style="font-size: 80%;">Resampling methods: Jackknife and Bootstrap</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs020.html#resampling-methods-jackknife" style="font-size: 80%;">Resampling methods: Jackknife</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs021.html#jackknife-code-example" style="font-size: 80%;">Jackknife code example</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs022.html#resampling-methods-bootstrap" style="font-size: 80%;">Resampling methods: Bootstrap</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs023.html#resampling-methods-bootstrap-background" style="font-size: 80%;">Resampling methods: Bootstrap background</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs024.html#resampling-methods-more-bootstrap-background" style="font-size: 80%;">Resampling methods: More Bootstrap background</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs025.html#resampling-methods-bootstrap-approach" style="font-size: 80%;">Resampling methods: Bootstrap approach</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs026.html#resampling-methods-bootstrap-steps" style="font-size: 80%;">Resampling methods: Bootstrap steps</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs027.html#code-example-for-the-bootstrap-method" style="font-size: 80%;">Code example for the Bootstrap method</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs028.html#various-steps-in-cross-validation" style="font-size: 80%;">Various steps in cross-validation</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs029.html#how-to-set-up-the-cross-validation-for-ridge-and-or-lasso" style="font-size: 80%;">How to set up the cross-validation for Ridge and/or Lasso</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs030.html#cross-validation-in-brief" style="font-size: 80%;">Cross-validation in brief</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs031.html#code-example-for-cross-validation-and-k-fold-cross-validation" style="font-size: 80%;">Code Example for Cross-validation and \( k \)-fold Cross-validation</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs032.html#the-bias-variance-tradeoff" style="font-size: 80%;">The bias-variance tradeoff</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs033.html#example-code-for-bias-variance-tradeoff" style="font-size: 80%;">Example code for Bias-Variance tradeoff</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs034.html#understanding-what-happens" style="font-size: 80%;">Understanding what happens</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs035.html#summing-up" style="font-size: 80%;">Summing up</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs036.html#another-example-from-scikit-learn-s-repository" style="font-size: 80%;">Another Example from Scikit-Learn's Repository</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs037.html#more-examples-on-bootstrap-and-cross-validation-and-errors" style="font-size: 80%;">More examples on bootstrap and cross-validation and errors</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs038.html#the-same-example-but-now-with-cross-validation" style="font-size: 80%;">The same example but now with cross-validation</a></li>
<!-- navigation toc: --> <li><a href="._week37-bs039.html#cross-validation-with-ridge" style="font-size: 80%;">Cross-validation with Ridge</a></li>
</ul>
</li>
@@ -167,7 +254,7 @@ MathJax.Hub.Config({
<div class="jumbotron">
<center><h1>Week 37: Ridge and Lasso Regression</h1></center> <!-- document title -->
<center><h1>Week 37: Summary of Ridge and Lasso Regression and Resampling Methods</h1></center> <!-- document title -->
<p>
<!-- author(s): Morten Hjorth-Jensen -->
@@ -183,7 +270,7 @@ MathJax.Hub.Config({
<center>[2] <b>Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University</b></center>
<br>
<p>
<center><h4>Sep 16, 2020</h4></center> <!-- date -->
<center><h4>Sep 12, 2021</h4></center> <!-- date -->
<br>
<p>
@@ -207,7 +294,7 @@ MathJax.Hub.Config({
<li><a href="._week37-bs008.html">9</a></li>
<li><a href="._week37-bs009.html">10</a></li>
<li><a href="">...</a></li>
<li><a href="._week37-bs026.html">27</a></li>
<li><a href="._week37-bs039.html">40</a></li>
<li><a href="._week37-bs001.html">&raquo;</a></li>
</ul>
<!-- ------------------- end of main content --------------- -->
@@ -219,13 +306,13 @@ MathJax.Hub.Config({
<!-- Bootstrap footer
<footer>
<a href="http://..."><img width="250" align=right src="http://..."></a>
<a href="https://..."><img width="250" align=right src="https://..."></a>
</footer>
-->
<center style="font-size:80%">
<!-- copyright --> &copy; 1999-2020, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
<!-- copyright --> &copy; 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
</center>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
+1220 -765
View File
File diff suppressed because it is too large Load Diff