lmsasu
lmsasu

Reputation: 7583

How do I find out the model produced by a GridSearchCV for any fold produced by cross_val_score?

I am using GridSearchCV to find out the best hyperparameters for a model. The cross_val_score is used for model assessment. How could I find out, for each fold, which hyperparameter was deduced by GridSearchCV?

Upvotes: 1

Views: 3513

Answers (1)

dooms
dooms

Reputation: 1645

In your GridSearchCV object, you can acces some attributes :

  • best_estimator_ : will give you the estimator maximizing your scoring method if you provide some or the score function of your estimator
  • best_score_ : score produced by your best estimator
  • best_params_ : parameters used to produce your best score
  • grid_scores_ : parameters, mean score and score of each fold (for all your fits)

Upvotes: 3

Related Questions