Ensemble Methods in Python
Román de las Heras
Data Scientist, Appodeal
base_estimator
n_estimators
oob_score
est_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_estimators
max_features
oob_score
Tree-specific parameters:
max_depth
min_samples_split
min_samples_leaf
class_weight
("balanced"
)Ensemble Methods in Python