Run ❯
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.ensemble import BaggingClassifier data = datasets.load_wine() X = data.data y = data.target X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 22) oob_model = BaggingClassifier(n_estimators = 12, oob_score = True,random_state = 22) oob_model.fit(X_train, y_train) print(oob_model.oob_score_)
0.9398496240601504