From 4024fbc40dec42cb8258812a1a8595421658769b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Wed, 18 May 2022 15:46:28 +1200 Subject: [PATCH] Add n_jobs=-1 for the BaggingClassifier --- 07_ensemble_learning_and_random_forests.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/07_ensemble_learning_and_random_forests.ipynb b/07_ensemble_learning_and_random_forests.ipynb index 70bc221..b204628 100644 --- a/07_ensemble_learning_and_random_forests.ipynb +++ b/07_ensemble_learning_and_random_forests.ipynb @@ -342,7 +342,7 @@ "data": { "text/plain": [ "BaggingClassifier(base_estimator=DecisionTreeClassifier(), max_samples=100,\n", - " n_estimators=500, random_state=42)" + " n_estimators=500, n_jobs=-1, random_state=42)" ] }, "execution_count": 12, @@ -355,7 +355,7 @@ "from sklearn.tree import DecisionTreeClassifier\n", "\n", "bag_clf = BaggingClassifier(DecisionTreeClassifier(), n_estimators=500,\n", - " max_samples=100, random_state=42)\n", + " max_samples=100, n_jobs=-1, random_state=42)\n", "bag_clf.fit(X_train, y_train)" ] }, @@ -438,7 +438,7 @@ ], "source": [ "bag_clf = BaggingClassifier(DecisionTreeClassifier(), n_estimators=500,\n", - " oob_score=True, random_state=42)\n", + " oob_score=True, n_jobs=-1, random_state=42)\n", "bag_clf.fit(X_train, y_train)\n", "bag_clf.oob_score_" ] @@ -2058,7 +2058,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.12" + "version": "3.9.10" }, "nav_menu": { "height": "252px",