Ensemble Methods in Python
Román de las Heras
Data Scientist, Appodeal
base_estimatorn_estimatorsoob_scoreest_bag.oob_score_max_samples: the number of samples to draw for each estimator.max_features: the number of features to draw for each estimator.bootstrap: whether samples are drawn with replacement.Classification
from sklearn.ensemble import RandomForestClassifier
clf_rf = RandomForestClassifier(
    # parameters...
)
Regression
from sklearn.ensemble import RandomForestRegressor
reg_rf = RandomForestRegressor(
    # parameters...
)
Bagging parameters:
n_estimatorsmax_featuresoob_scoreTree-specific parameters:
max_depthmin_samples_splitmin_samples_leafclass_weight ("balanced")
Ensemble Methods in Python