corrected typo

This commit is contained in:
Morten Hjorth-Jensen
2021-09-09 16:42:37 +02:00
parent 419f83c93a
commit 3044ad351c
6 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -1023,7 +1023,7 @@ lambdas = np.logspace(-<span style="color: #B452CD">4</span>, <span style="color
<span style="color: #228B22"># print(MSEPredict[i])</span>
<span style="color: #228B22"># Now plot the results</span>
plt.figure()
plt.plot(np.log10(lambdas), MSEPredict, <span style="color: #CD5555">&#39;r--&#39;</span>, label = <span style="color: #CD5555">&#39;MSE Ridge Test&#39;</span>)
plt.plot(np.log10(lambdas), MSEPredict, <span style="color: #CD5555">&#39;r--&#39;</span>, label = <span style="color: #CD5555">&#39;MSE Ridge Train&#39;</span>)
plt.xlabel(<span style="color: #CD5555">&#39;log10(lambda)&#39;</span>)
plt.ylabel(<span style="color: #CD5555">&#39;MSE&#39;</span>)
plt.legend()
@@ -1086,7 +1086,7 @@ lambdas = np.logspace(-<span style="color: #B452CD">4</span>, <span style="color
RegLasso = linear_model.Lasso(lmb)
RegLasso.fit(X,y)
ypredictLasso = RegLasso.predict(X)
<span style="color: #658b00">print</span>(RegLasso_coef_)
<span style="color: #658b00">print</span>(RegLasso.coef_)
MSELassoPredict[i] = MSE(y,ypredictLasso)
<span style="color: #228B22"># Now plot the results</span>
plt.figure()
+2 -2
View File
@@ -1046,7 +1046,7 @@ lambdas = np.logspace(-<span style="color: #B452CD">4</span>, <span style="color
<span style="color: #228B22"># print(MSEPredict[i])</span>
<span style="color: #228B22"># Now plot the results</span>
plt.figure()
plt.plot(np.log10(lambdas), MSEPredict, <span style="color: #CD5555">&#39;r--&#39;</span>, label = <span style="color: #CD5555">&#39;MSE Ridge Test&#39;</span>)
plt.plot(np.log10(lambdas), MSEPredict, <span style="color: #CD5555">&#39;r--&#39;</span>, label = <span style="color: #CD5555">&#39;MSE Ridge Train&#39;</span>)
plt.xlabel(<span style="color: #CD5555">&#39;log10(lambda)&#39;</span>)
plt.ylabel(<span style="color: #CD5555">&#39;MSE&#39;</span>)
plt.legend()
@@ -1109,7 +1109,7 @@ lambdas = np.logspace(-<span style="color: #B452CD">4</span>, <span style="color
RegLasso = linear_model.Lasso(lmb)
RegLasso.fit(X,y)
ypredictLasso = RegLasso.predict(X)
<span style="color: #658b00">print</span>(RegLasso_coef_)
<span style="color: #658b00">print</span>(RegLasso.coef_)
MSELassoPredict[i] = MSE(y,ypredictLasso)
<span style="color: #228B22"># Now plot the results</span>
plt.figure()
+2 -2
View File
@@ -1051,7 +1051,7 @@ lambdas <span style="color: #666666">=</span> np<span style="color: #666666">.</
<span style="color: #408080; font-style: italic"># print(MSEPredict[i])</span>
<span style="color: #408080; font-style: italic"># Now plot the results</span>
plt<span style="color: #666666">.</span>figure()
plt<span style="color: #666666">.</span>plot(np<span style="color: #666666">.</span>log10(lambdas), MSEPredict, <span style="color: #BA2121">&#39;r--&#39;</span>, label <span style="color: #666666">=</span> <span style="color: #BA2121">&#39;MSE Ridge Test&#39;</span>)
plt<span style="color: #666666">.</span>plot(np<span style="color: #666666">.</span>log10(lambdas), MSEPredict, <span style="color: #BA2121">&#39;r--&#39;</span>, label <span style="color: #666666">=</span> <span style="color: #BA2121">&#39;MSE Ridge Train&#39;</span>)
plt<span style="color: #666666">.</span>xlabel(<span style="color: #BA2121">&#39;log10(lambda)&#39;</span>)
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">&#39;MSE&#39;</span>)
plt<span style="color: #666666">.</span>legend()
@@ -1114,7 +1114,7 @@ lambdas <span style="color: #666666">=</span> np<span style="color: #666666">.</
RegLasso <span style="color: #666666">=</span> linear_model<span style="color: #666666">.</span>Lasso(lmb)
RegLasso<span style="color: #666666">.</span>fit(X,y)
ypredictLasso <span style="color: #666666">=</span> RegLasso<span style="color: #666666">.</span>predict(X)
<span style="color: #008000">print</span>(RegLasso_coef_)
<span style="color: #008000">print</span>(RegLasso<span style="color: #666666">.</span>coef_)
MSELassoPredict[i] <span style="color: #666666">=</span> MSE(y,ypredictLasso)
<span style="color: #408080; font-style: italic"># Now plot the results</span>
plt<span style="color: #666666">.</span>figure()
Binary file not shown.
+2 -2
View File
@@ -1296,7 +1296,7 @@
"# print(MSEPredict[i])\n",
" # Now plot the results\n",
"plt.figure()\n",
"plt.plot(np.log10(lambdas), MSEPredict, 'r--', label = 'MSE Ridge Test')\n",
"plt.plot(np.log10(lambdas), MSEPredict, 'r--', label = 'MSE Ridge Train')\n",
"plt.xlabel('log10(lambda)')\n",
"plt.ylabel('MSE')\n",
"plt.legend()\n",
@@ -1368,7 +1368,7 @@
" RegLasso = linear_model.Lasso(lmb)\n",
" RegLasso.fit(X,y)\n",
" ypredictLasso = RegLasso.predict(X)\n",
" print(RegLasso_coef_)\n",
" print(RegLasso.coef_)\n",
" MSELassoPredict[i] = MSE(y,ypredictLasso)\n",
"# Now plot the results\n",
"plt.figure()\n",
+2 -2
View File
@@ -737,7 +737,7 @@ for i in range(nlambdas):
# print(MSEPredict[i])
# Now plot the results
plt.figure()
plt.plot(np.log10(lambdas), MSEPredict, 'r--', label = 'MSE Ridge Test')
plt.plot(np.log10(lambdas), MSEPredict, 'r--', label = 'MSE Ridge Train')
plt.xlabel('log10(lambda)')
plt.ylabel('MSE')
plt.legend()
@@ -798,7 +798,7 @@ for i in range(nlambdas):
RegLasso = linear_model.Lasso(lmb)
RegLasso.fit(X,y)
ypredictLasso = RegLasso.predict(X)
print(RegLasso_coef_)
print(RegLasso.coef_)
MSELassoPredict[i] = MSE(y,ypredictLasso)
# Now plot the results
plt.figure()