This commit is contained in:
Morten Hjorth-Jensen
2023-09-11 13:55:30 +02:00
parent e3467051c8
commit b1a5156248
8 changed files with 191 additions and 183 deletions
+1
View File
@@ -308,6 +308,7 @@ MathJax.Hub.Config({
<ul>
<li> Hastie et al Chapter 7, here we recommend 7.1-7.5 and 7.10 (cross-validation) and 7.11 (bootstrap).</li>
<li> <a href="https://www.youtube.com/watch?v=fSytzGwwBVw" target="_self">Video on cross validation</a></li>
<li> <a href="https://www.youtube.com/watch?v=Xz0x-8-cgaQ" target="_self">Video on Bootstrapping</a></li>
<li> <a href="https://www.youtube.com/watch?v=EuBBz3bI-aA" target="_self">Video on bias-variance tradeoff</a></li>
</ul>
</ul>
+2
View File
@@ -232,6 +232,8 @@ MathJax.Hub.Config({
<p><li> <a href="https://www.youtube.com/watch?v=fSytzGwwBVw" target="_blank">Video on cross validation</a></li>
<p><li> <a href="https://www.youtube.com/watch?v=Xz0x-8-cgaQ" target="_blank">Video on Bootstrapping</a></li>
<p><li> <a href="https://www.youtube.com/watch?v=EuBBz3bI-aA" target="_blank">Video on bias-variance tradeoff</a></li>
</ul>
<p>
@@ -281,6 +281,7 @@ MathJax.Hub.Config({
<ul>
<li> Hastie et al Chapter 7, here we recommend 7.1-7.5 and 7.10 (cross-validation) and 7.11 (bootstrap).</li>
<li> <a href="https://www.youtube.com/watch?v=fSytzGwwBVw" target="_blank">Video on cross validation</a></li>
<li> <a href="https://www.youtube.com/watch?v=Xz0x-8-cgaQ" target="_blank">Video on Bootstrapping</a></li>
<li> <a href="https://www.youtube.com/watch?v=EuBBz3bI-aA" target="_blank">Video on bias-variance tradeoff</a></li>
</ul>
</ul>
+1
View File
@@ -358,6 +358,7 @@ MathJax.Hub.Config({
<ul>
<li> Hastie et al Chapter 7, here we recommend 7.1-7.5 and 7.10 (cross-validation) and 7.11 (bootstrap).</li>
<li> <a href="https://www.youtube.com/watch?v=fSytzGwwBVw" target="_blank">Video on cross validation</a></li>
<li> <a href="https://www.youtube.com/watch?v=Xz0x-8-cgaQ" target="_blank">Video on Bootstrapping</a></li>
<li> <a href="https://www.youtube.com/watch?v=EuBBz3bI-aA" target="_blank">Video on bias-variance tradeoff</a></li>
</ul>
</ul>
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -547,7 +547,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 45,
"id": "a721dffd",
"metadata": {},
"outputs": [
@@ -555,13 +555,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[0. 0.5 3.7]\n",
"[0. 0.49997445 3.69992817]\n",
"2.000000000000007\n",
"[0.5 3.7]\n",
"[0.49997445 3.69992817]\n",
"1.9999999999999947\n",
"2.00021345091295\n",
" \n",
"test MSE of OLS\n",
"3.729339929432333e-29\n",
"1.7086727207087115e-28\n",
" \n",
"test MSE of Ridge\n",
"6.420926689334773e-08\n"
@@ -582,7 +582,7 @@
"from sklearn import linear_model\n",
"np.random.seed(2018)\n",
"n = 100\n",
"d = 3\n",
"d = 2\n",
"Lambda = 0.01\n",
"true_beta = [2, 0.5, 3.7]\n",
"\n",
@@ -595,7 +595,7 @@
"#Design matrix X does include the intercept. \n",
"X = np.zeros((n, d))\n",
"for p in range(d): \n",
" X[:, p] = x ** (p)\n",
" X[:, p] = x ** (p+1)\n",
"\n",
"\n",
"#Split data in train and test\n",
@@ -644,7 +644,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8b3b48ac",
"id": "cf021a10",
"metadata": {},
"outputs": [],
"source": []
+1
View File
@@ -21,6 +21,7 @@ DATE: today
* Reads and Videos:
* Hastie et al Chapter 7, here we recommend 7.1-7.5 and 7.10 (cross-validation) and 7.11 (bootstrap).
* "Video on cross validation":"https://www.youtube.com/watch?v=fSytzGwwBVw"
* "Video on Bootstrapping":"https://www.youtube.com/watch?v=Xz0x-8-cgaQ"
* "Video on bias-variance tradeoff":"https://www.youtube.com/watch?v=EuBBz3bI-aA"
!eblock