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...
)
バギングのパラメータ:
n_estimatorsmax_featuresoob_score木固有のパラメータ:
max_depthmin_samples_splitmin_samples_leafclass_weight ("balanced")
Pythonで学ぶアンサンブル手法