mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +01:00
X_train, y_train instead of X, y, fixes #474
This commit is contained in:
@@ -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()"
|
||||
|
||||
Reference in New Issue
Block a user