Created
September 15, 2022 12:49
-
-
Save Abhayparashar31/12a0e279b1d8cad8c465f6a0827c8fe0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## Bagging Ensemble of Same Classifiers (Decision Trees) | |
from sklearn.ensemble import RandomForestClassifier | |
classifier= RandomForestClassifier(n_estimators= 10, criterion="entropy") | |
classifier.fit(x_train, y_train) | |
## Bagging Ensemble of Different Classifiers | |
from sklearn.ensemble import BaggingClassifier | |
from sklearn.svm import SVC | |
clf = BaggingClassifier(base_estimator=SVC(), | |
n_estimators=10, random_state=0) | |
clf.fit(X_train,y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment