Fix early stopping example, fixes #190
parent
df651cafb6
commit
05622d26b8
|
@ -845,7 +845,7 @@
|
|||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from sklearn.base import clone\n",
|
||||
"from copy import deepcopy\n",
|
||||
"\n",
|
||||
"poly_scaler = Pipeline([\n",
|
||||
" (\"poly_features\", PolynomialFeatures(degree=90, include_bias=False)),\n",
|
||||
|
@ -868,8 +868,7 @@
|
|||
" if val_error < minimum_val_error:\n",
|
||||
" minimum_val_error = val_error\n",
|
||||
" best_epoch = epoch\n",
|
||||
" best_model = sgd_reg\n",
|
||||
" sgd_reg = clone(sgd_reg)"
|
||||
" best_model = deepcopy(sgd_reg)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue