利用訓練檔:train_data.csv,做為隨機森林的範例
完整程式碼
輸出績效結果
參數說明如下:
| n_estimators | 隨機森林中樹的數量(預設為100顆可設10到100顆) |
| criterion | 同決策樹 |
| max_depth | 同決策樹 |
| min_samples_leaf | 同決策樹 |
| min_weight_fraction_leaf | 同決策樹 |
| max_features | 同決策樹 |
| max_leaf_nodes | 同決策樹 |
| bootstrap | 是否有放回的採樣。 |
| oob_score | 是否進行模型驗證。 |
| class_weight | 各個標籤權重 |