Ensemble Methods in Python
Román de las Heras
Data Scientist, Appodeal
base_estimatorn_estimatorsoob_scoreest_bag.oob_score_max_samples: số mẫu lấy cho mỗi estimator.max_features: số đặc trưng lấy cho mỗi estimator.bootstrap: có lấy mẫu hoàn lại hay không.Phân loại
from sklearn.ensemble import RandomForestClassifier
clf_rf = RandomForestClassifier(
# parameters...
)
Hồi quy
from sklearn.ensemble import RandomForestRegressor
reg_rf = RandomForestRegressor(
# parameters...
)
Tham số bagging:
n_estimatorsmax_featuresoob_scoreTham số riêng của cây:
max_depthmin_samples_splitmin_samples_leafclass_weight ("balanced")
Ensemble Methods in Python