Databricks Machine Learning Associate Question 594
Single answerA data scientist is training a machine learning model using a grid-search process to tune hyperparameters. They define a parameter grid with 3 values for the learning rate, 4 values for the batch size, and 2 values for the number of layers. They use 5-fold cross-validation during the training process. How many total models will be trained during this operation?
- A
30 models
- B
120 models
- C
60 models
- D
240 models
Show answer and explanation
Correct answer: B
Explanation
The total number of models trained during a grid-search with cross-validation is calculated by multiplying the total number of parameter combinations in the grid by the number of cross-validation folds. In this case, the parameter grid has 3 x 4 x 2 = 24 combinations, and 5-fold cross-validation is applied, leading to 24 x 5 = 120 models being trained.
- A. Incorrect.
Incorrect. This assumes only the parameter combinations were multiplied without considering cross-validation.
- B. Correct.
Correct. The total number of models is calculated by multiplying the number of parameter combinations (3 x 4 x 2 = 24) by the number of cross-validation folds (5), resulting in 120 models.
- C. Incorrect.
Incorrect. This calculation assumes an incorrect number of parameter combinations or folds.
- D. Incorrect.
Incorrect. This overestimates the total number of models, likely doubling the correct result.