Get Your CertDatabricks Certified Machine Learning AssociatePlayCompete
‹ All Databricks Certified Machine Learning Associate questions

Databricks ML Associate Practice Question 3: MLflow Search Best Run

Databricks Certified Machine Learning Associate · Test 1 · question 3 of 10

MLflow Trackingmedium

An experiment holds about 200 runs from a regression tuning session, and each run logged the metric val_rmse. In a notebook, you need the ID of the single run with the best validation error so you can register its model.

Which call returns that run?

Select one answer
Show answer and explanation

Answer:

  • A. mlflow.search_runs(experiment_ids=[exp_id], order_by=["metrics.val_rmse ASC"], max_results=1)

RMSE is an error metric, so lower is better. mlflow.search_runs returns matching runs as a pandas DataFrame. Sorting on metrics.val_rmse ASC puts the lowest error first, and max_results=1 keeps only that row. Its run_id column gives the run whose model you register.

Option B sorts descending, which returns the run with the worst validation RMSE. Descending order is right for metrics where higher is better, such as accuracy or R-squared.

Option C is not valid search syntax. filter_string compares a metric to a literal value (metrics.val_rmse < 5); it has no aggregate like min.

Option D returns the most recent run started by the current process, not the best one. It knows nothing about metric values.

Reference: Search Runs

Practice Test 1 ›

Study guides for Databricks Certified Machine Learning Associate