From c14e87edc7574f213cd016f320e666b5874caa09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Wed, 6 Oct 2021 19:13:44 +1300 Subject: [PATCH] X_train, y_train instead of X, y, fixes #474 --- 07_ensemble_learning_and_random_forests.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07_ensemble_learning_and_random_forests.ipynb b/07_ensemble_learning_and_random_forests.ipynb index 7558d0f..f8b6789 100644 --- a/07_ensemble_learning_and_random_forests.ipynb +++ b/07_ensemble_learning_and_random_forests.ipynb @@ -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()"