Last active
December 28, 2020 08:38
-
-
Save wmlba/803147cce5526004feae574ff92ed164 to your computer and use it in GitHub Desktop.
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 imblearn.ensemble import BalancedBaggingClassifier | |
from sklearn.tree import DecisionTreeClassifier | |
#Create an object of the classifier. | |
bbc = BalancedBaggingClassifier(base_estimator=DecisionTreeClassifier(), | |
sampling_strategy='auto', | |
replacement=False, | |
random_state=0) | |
y_train = credit_df['Class'] | |
X_train = credit_df.drop(['Class'], axis=1, inplace=False) | |
#Train the classifier. | |
bbc.fit(X_train, y_train) | |
preds = bbc.predict(X_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment