官术网_书友最值得收藏!

Training the random forest

Training the random forest model is not very different from training the decision tree:

In []: 
from sklearn.ensemble import RandomForestClassifier 
rf_model = RandomForestClassifier(criterion = 'entropy', random_state=42) 
rf_model = rf_model.fit(X_train, y_train) 
print(rf_model) 
Out[]: 
RandomForestClassifier(bootstrap=True, class_weight=None, criterion='entropy', 
            max_depth=None, max_features='auto', max_leaf_nodes=None, 
            min_impurity_split=1e-07, min_samples_leaf=1, 
            min_samples_split=2, min_weight_fraction_leaf=0.0, 
            n_estimators=10, n_jobs=1, oob_score=False, random_state=42, 
            verbose=0, warm_start=False) 
主站蜘蛛池模板: 新蔡县| 美姑县| 疏附县| 太仆寺旗| 万全县| 靖州| 华宁县| 四平市| 右玉县| 镇巴县| 南澳县| 元朗区| 县级市| 长治市| 绩溪县| 成都市| 航空| 和平县| 黄骅市| 宁陵县| 雷山县| 延庆县| 南华县| 墨竹工卡县| 秭归县| 昭觉县| 谷城县| 神农架林区| 嵩明县| 田林县| 峨眉山市| 永寿县| 政和县| 卢湾区| 方正县| 门源| 革吉县| 松原市| 藁城市| 永德县| 武穴市|