corrected typo
This commit is contained in:
@@ -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">'r--'</span>, label = <span style="color: #CD5555">'MSE Ridge Test'</span>)
|
||||
plt.plot(np.log10(lambdas), MSEPredict, <span style="color: #CD5555">'r--'</span>, label = <span style="color: #CD5555">'MSE Ridge Train'</span>)
|
||||
plt.xlabel(<span style="color: #CD5555">'log10(lambda)'</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">'MSE'</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()
|
||||
|
||||
@@ -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">'r--'</span>, label = <span style="color: #CD5555">'MSE Ridge Test'</span>)
|
||||
plt.plot(np.log10(lambdas), MSEPredict, <span style="color: #CD5555">'r--'</span>, label = <span style="color: #CD5555">'MSE Ridge Train'</span>)
|
||||
plt.xlabel(<span style="color: #CD5555">'log10(lambda)'</span>)
|
||||
plt.ylabel(<span style="color: #CD5555">'MSE'</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()
|
||||
|
||||
@@ -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">'r--'</span>, label <span style="color: #666666">=</span> <span style="color: #BA2121">'MSE Ridge Test'</span>)
|
||||
plt<span style="color: #666666">.</span>plot(np<span style="color: #666666">.</span>log10(lambdas), MSEPredict, <span style="color: #BA2121">'r--'</span>, label <span style="color: #666666">=</span> <span style="color: #BA2121">'MSE Ridge Train'</span>)
|
||||
plt<span style="color: #666666">.</span>xlabel(<span style="color: #BA2121">'log10(lambda)'</span>)
|
||||
plt<span style="color: #666666">.</span>ylabel(<span style="color: #BA2121">'MSE'</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.
@@ -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",
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user