Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Databricks Certified Machine Learning Associate · Databricks
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
In Hyperopt, the fmin function is designed to minimize the objective function. In this code, the objective_function is returning the R² score directly, which typically ranges from 0 to 1 (or possibly negative if the model is poor). Since higher R² values indicate better model performance, the fmin function would mistakenly aim to minimize it, selecting configurations with lower R² values. To correct this, the data scientist should return the negative R² value (i.e., -r2). By minimizing -r2, fmin will effectively maximize the R² score, leading to better model accuracy
the answer is D: The fmin function in Hyperopt is designed to minimize the objective function. In the provided code, the objective function returns the R-squared value (r2), which is a measure of how well the model explains the variance in the target variable. Since higher R-squared values indicate better model performance, the goal is to maximize this value. However, fmin minimizes the objective function, so you need to return the negative R-squared value to effectively maximize it.