X_train, y_train instead of X, y, fixes #474

main
Aurélien Geron 2021-10-06 19:13:44 +13:00
parent 3f89676892
commit c14e87edc7
1 changed files with 1 additions and 1 deletions

View File

@ -496,7 +496,7 @@
"for i in range(15):\n",
" tree_clf = DecisionTreeClassifier(max_leaf_nodes=16, random_state=42 + i)\n",
" indices_with_replacement = np.random.randint(0, len(X_train), len(X_train))\n",
" tree_clf.fit(X[indices_with_replacement], y[indices_with_replacement])\n",
" tree_clf.fit(X_train[indices_with_replacement], y_train[indices_with_replacement])\n",
" plot_decision_boundary(tree_clf, X, y, axes=[-1.5, 2.45, -1, 1.5], alpha=0.02, contour=False)\n",
"\n",
"plt.show()"