Ансамблеві методи в Python
Román de las Heras
Data Scientist, Appodeal
base_estimatorn_estimatorsoob_scoreest_bag.oob_score_max_samples: кількість вибірок для кожного оцінювача.max_features: кількість ознак для кожного оцінювача.bootstrap: чи вибірки з поверненням.Класифікація
from sklearn.ensemble import RandomForestClassifier
clf_rf = RandomForestClassifier(
# parameters...
)
Регресія
from sklearn.ensemble import RandomForestRegressor
reg_rf = RandomForestRegressor(
# parameters...
)
Параметри bagging:
n_estimatorsmax_featuresoob_scoreПараметри дерев:
max_depthmin_samples_splitmin_samples_leafclass_weight ("balanced")
Ансамблеві методи в Python