mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-02-02 21:17:49 +01:00
Fix early stopping example, fixes #190
This commit is contained in:
@@ -845,7 +845,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from sklearn.base import clone\n",
|
"from copy import deepcopy\n",
|
||||||
"\n",
|
"\n",
|
||||||
"poly_scaler = Pipeline([\n",
|
"poly_scaler = Pipeline([\n",
|
||||||
" (\"poly_features\", PolynomialFeatures(degree=90, include_bias=False)),\n",
|
" (\"poly_features\", PolynomialFeatures(degree=90, include_bias=False)),\n",
|
||||||
@@ -868,8 +868,7 @@
|
|||||||
" if val_error < minimum_val_error:\n",
|
" if val_error < minimum_val_error:\n",
|
||||||
" minimum_val_error = val_error\n",
|
" minimum_val_error = val_error\n",
|
||||||
" best_epoch = epoch\n",
|
" best_epoch = epoch\n",
|
||||||
" best_model = sgd_reg\n",
|
" best_model = deepcopy(sgd_reg)"
|
||||||
" sgd_reg = clone(sgd_reg)"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user