Created
December 6, 2017 10:48
-
-
Save sagarhowal/c7afc840bda64dda1b0983968794a346 to your computer and use it in GitHub Desktop.
Bagging Pasting for Ensemble Learning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.ensemble import BaggingClassifier | |
from sklearn.tree import DecisionTreeClassifier | |
bag_clf = BaggingClassifier( | |
DecisionTreeClassifier(random_state=42), n_estimators=500, | |
max_samples=100, bootstrap=True, n_jobs=-1, random_state=42) | |
bag_clf.fit(X_train, y_train) | |
y_pred = bag_clf.predict(X_test) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment