1. Home
  2. Data Science
  3. Scikit-learn
  4. What does GridSearchCV do with a parameter grid?

Added 30 Nov -0001

What does GridSearchCV do with a parameter grid?

  1. Uses the first combination that beats a fixed threshold
  2. Trains and cross-validates every listed combination Correct answer
  3. Trains one model per parameter name, ignoring values
  4. Samples random combinations until time runs out

Correct answer

B. Trains and cross-validates every listed combination

17 views

MCQSEXAM

Explanation

GridSearchCV enumerates the Cartesian product of the supplied parameter values, evaluates each combination with cross-validation, and keeps the one with the best mean score in best_params_. It exposes the refitted winner as best_estimator_, which is trained on all the data. The cost grows multiplicatively with grid size, so RandomizedSearchCV is used when the space is large.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs