update week 39

This commit is contained in:
Morten Hjorth-Jensen
2021-09-28 21:03:20 +02:00
parent b2fb41d199
commit 0a4e451fea
6 changed files with 15 additions and 0 deletions
+3
View File
@@ -303,6 +303,9 @@ ypredictRidge = gridsearch.predict(X_test)
</pre></div>
<p>
By default the grid search function includes cross validation with five folds. The <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html#sklearn.model_selection.GridSearchCV" target="_blank">Scikit-Learn documentation</a> contains more information on how to set the different parameters.
<p>
If we take out the random noise, running the above codes results in \( \lambda=0 \) yielding the best fit.
</section>
@@ -388,6 +388,9 @@ ypredictRidge = gridsearch.predict(X_test)
<p>
By default the grid search function includes cross validation with five folds. The <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html#sklearn.model_selection.GridSearchCV" target="_blank">Scikit-Learn documentation</a> contains more information on how to set the different parameters.
<p>
If we take out the random noise, running the above codes results in \( \lambda=0 \) yielding the best fit.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
+3
View File
@@ -393,6 +393,9 @@ ypredictRidge <span style="color: #666666">=</span> gridsearch<span style="color
<p>
By default the grid search function includes cross validation with five folds. The <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html#sklearn.model_selection.GridSearchCV" target="_blank">Scikit-Learn documentation</a> contains more information on how to set the different parameters.
<p>
If we take out the random noise, running the above codes results in \( \lambda=0 \) yielding the best fit.
<p>
<!-- !split --><br><br><br><br><br><br><br><br><br><br>
Binary file not shown.
+3
View File
@@ -176,6 +176,9 @@
"source": [
"By default the grid search function includes cross validation with five folds. The [Scikit-Learn documentation](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html#sklearn.model_selection.GridSearchCV) contains more information on how to set the different parameters.\n",
"\n",
"If we take out the random noise, running the above codes results in $\\lambda=0$ yielding the best fit. \n",
"\n",
"\n",
"## Randomized Grid Search\n",
"\n",
"An alternative to the above manual grid set up, is to use a random\n",
+3
View File
@@ -139,6 +139,9 @@ print(f"R2 score: {R2(y_test,ypredictRidge)}")
By default the grid search function includes cross validation with five folds. The "Scikit-Learn documentation":"https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html#sklearn.model_selection.GridSearchCV" contains more information on how to set the different parameters.
If we take out the random noise, running the above codes results in $\lambda=0$ yielding the best fit.
!split
===== Randomized Grid Search =====