Which command retrieves the run_id of the best run in an MLflow experiment?

Prepare for the Databricks Machine Learning Associate Exam with our test. Access flashcards, multiple choice questions, hints, and explanations for comprehensive preparation.

The command that correctly retrieves the run_id of the best run in an MLflow experiment is the one where runs are searched, filtered, and ordered based on a specific metric. By using mlflow.search_runs([experiment_id], order_by=["metrics.r2 DESC"]), you are performing a query that not only fetches the runs associated with a given experiment ID but also sorts them based on the r2 metric in descending order.

Since the best run is defined as the one with the highest r2 score, this command effectively brings the best run to the top of the results. You can then access the run_id of that top entry, providing you with the identification needed for further operations.

This method is efficient as it allows you to dynamically search for the best-performing model based on its performance metrics rather than relying solely on predefined identifiers or simpler retrieval methods.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy