Databricks Machine Learning Associate Question 246
Single answerYou are training a machine learning model in Databricks and want to optimize its performance by tuning hyperparameters. You decide to use a grid-search approach combined with cross-validation. Which of the following statements about this process is correct?
- A
Grid-search systematically evaluates all combinations of hyperparameter values provided for tuning.
- B
Cross-validation ensures that the model is evaluated on unseen data by splitting the dataset into training and testing subsets once.
- C
Grid-search automatically selects the best hyperparameters based on a user-provided scoring metric, such as accuracy or RMSE.
- D
Cross-validation helps reduce overfitting by averaging the evaluation scores across multiple data splits.
Show answer and explanation
Correct answer: A
Explanation
Grid-search is a systematic method of hyperparameter tuning where all parameter combinations in the specified grid are evaluated. When combined with cross-validation, it ensures that hyperparameter optimization is robust by evaluating the model on multiple training and validation splits. This process helps identify the best-performing hyperparameters while reducing the risk of overfitting or overestimating model performance.
- A. Correct.
Correct. Grid-search exhaustively evaluates all possible combinations of hyperparameter values provided in the parameter grid, making it a systematic and comprehensive method for hyperparameter tuning.
- B. Incorrect.
Incorrect. Cross-validation splits the dataset multiple times into different training and validation subsets, not just once, to ensure robust evaluation of the model's performance.
- C. Incorrect.
Incorrect. While grid-search evaluates hyperparameters, it does not automatically select them unless combined with a scoring function provided by the user. The selection depends on the scoring metric, but the primary task of grid-search is evaluation.
- D. Incorrect.
Incorrect. Although cross-validation can reduce overfitting, its primary purpose is to provide a robust estimation of model performance on unseen data. Averaging scores across splits indirectly helps, but it is not the primary mechanism to prevent overfitting.