How to tune parameters in Random Forest, using Scikit Learn?

前端 未结 4 2051
滥情空心
滥情空心 2020-12-23 09:47
class sklearn.ensemble.RandomForestClassifier(n_estimators=10,
                                              criterion=\'gini\', 
                                            


        
4条回答
  •  北海茫月
    2020-12-23 10:20

    The crucial parts are usually three elements:

    • number of estimators - usually bigger the forest the better, there is small chance of overfitting here
    • max depth of each tree (default none, leading to full tree) - reduction of the maximum depth helps fighting with overfitting
    • max features per split (default sqrt(d)) - you might one to play around a bit as it significantly alters behaviour of the whole tree. sqrt heuristic is usually a good starting point but an actual sweet spot might be somewhere else

提交回复
热议问题