Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Machine Learning Associate All Questions

View all questions & answers for the Certified Machine Learning Associate exam

Exam Certified Machine Learning Associate topic 1 question 13 discussion

Actual exam question from Databricks's Certified Machine Learning Associate
Question #: 13
Topic #: 1
[All Certified Machine Learning Associate Questions]

A data scientist wants to efficiently tune the hyperparameters of a scikit-learn model. They elect to use the Hyperopt library's fmin operation to facilitate this process. Unfortunately, the final model is not very accurate. The data scientist suspects that there is an issue with the objective_function being passed as an argument to fmin.
They use the following code block to create the objective_function:

Which of the following changes does the data scientist need to make to their objective_function in order to produce a more accurate model?

  • A. Add test set validation process
  • B. Add a random_state argument to the RandomForestRegressor operation
  • C. Remove the mean operation that is wrapping the cross_val_score operation
  • D. Replace the r2 return value with -r2
  • E. Replace the fmin operation with the fmax operation
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Deuterium44
2 weeks, 3 days ago
Selected Answer: D
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
upvoted 1 times
...
8605246
5 months, 1 week ago
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.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...