Skip to content
Permalink
Browse files

bst_n_estimators should be argmin(errors) + 1, fixes #445

  • Loading branch information...
ageron committed Jun 8, 2019
1 parent 5954b06 commit 8663460e9d95e62c0206e6a7b1c1cdbf5dc5ef04
Showing with 1 addition and 1 deletion.
  1. +1 −1 07_ensemble_learning_and_random_forests.ipynb
@@ -1556,7 +1556,7 @@
"\n",
"errors = [mean_squared_error(y_val, y_pred)\n",
" for y_pred in gbrt.staged_predict(X_val)]\n",
"bst_n_estimators = np.argmin(errors)\n",
"bst_n_estimators = np.argmin(errors) + 1\n",
"\n",
"gbrt_best = GradientBoostingRegressor(max_depth=2,n_estimators=bst_n_estimators, random_state=42)\n",
"gbrt_best.fit(X_train, y_train)"

0 comments on commit 8663460

Please sign in to comment.
You can’t perform that action at this time.