How to get Best Estimator on GridSearchCV (Random Forest Classifier Scikit)

前端 未结 2 1256
遥遥无期
遥遥无期 2020-12-04 16:49

I\'m running GridSearch CV to optimize the parameters of a classifier in scikit. Once I\'m done, I\'d like to know which parameters were chosen as the best.

Whenever

2条回答
  •  星月不相逢
    2020-12-04 17:19

    Just to add one more point to keep it clear.

    The document says the following:

    best_estimator_ : estimator or dict:

    Estimator that was chosen by the search, i.e. estimator which gave highest score (or smallest loss if specified) on the left out data.

    When the grid search is called with various params, it chooses the one with the highest score based on the given scorer func. Best estimator gives the info of the params that resulted in the highest score.

    Therefore, this can only be called after fitting the data.

提交回复
热议问题