Databricks Machine Learning Associate Question 592
Single answerYou are performing hyperparameter tuning using a grid search with cross-validation on a dataset. The grid search tests 4 combinations of hyperparameters, and 5-fold cross-validation is applied. How many total models will be trained during this process?
- A
4
- B
5
- C
20
- D
10
Show answer and explanation
Correct answer: C
Explanation
Grid search evaluates each hyperparameter combination using cross-validation. With 4 hyperparameter combinations and 5-fold cross-validation, each combination is trained on 5 different splits of the data. Therefore, the total number of models trained is 4 * 5 = 20.
- A. Incorrect.
This is incorrect because 4 is the number of hyperparameter combinations, but cross-validation requires training multiple models for each combination.
- B. Incorrect.
This is incorrect because 5 is the number of folds in cross-validation, but does not account for the 4 hyperparameter combinations being tested.
- C. Correct.
This is correct because with 4 hyperparameter combinations and 5-fold cross-validation, each combination is trained on 5 different train-validation splits, resulting in a total of 4 * 5 = 20 models.
- D. Incorrect.
This is incorrect because 10 does not match the calculation of 4 hyperparameter combinations and 5-fold cross-validation (4 * 5 = 20).