Databricks Machine Learning Associate Question 453
Select 3You are using the MLflow Client API to determine the best run from an experiment based on the highest accuracy metric. Which of the following steps should you implement to achieve this?
- A
Use the
mlflow.search_runsmethod to retrieve all runs for the experiment. - B
Filter the runs using the
order_byparameter to sort them by the accuracy metric in descending order. - C
Retrieve the run with the highest accuracy by selecting the first entry in the sorted results.
- D
Use the
mlflow.get_runmethod to fetch all runs with a tag indicating the best run. - E
Export the runs to a CSV file and manually identify the run with the highest accuracy.
Show answer and explanation
Correct answers: A, B, C
Explanation
To identify the best run using the MLflow Client API, you first need to retrieve all runs associated with the experiment using mlflow.search_runs. Then, you can use the order_by parameter to sort the runs by the desired metric, such as accuracy, in descending order. Finally, the best run can be identified as the first entry in the sorted results. This approach is efficient and leverages the functionality provided by the MLflow Client API.
- A. Correct.
Correct. The
mlflow.search_runsmethod is used to retrieve all runs for a given experiment, which is necessary to find the run with the highest accuracy. - B. Correct.
Correct. The
order_byparameter allows you to sort the runs by a specific metric, such as accuracy, in descending order to identify the best run. - C. Correct.
Correct. Once the runs are sorted by the accuracy metric in descending order, the first entry in the results will correspond to the best run.
- D. Incorrect.
Incorrect. The
mlflow.get_runmethod is used to retrieve a specific run by its run ID, not to filter or identify runs with the best metric value. - E. Incorrect.
Incorrect. Exporting runs to a CSV file and manually identifying the best run is inefficient and not a recommended practice when using the MLflow Client API.