Which MLflow Client API call finds the run with the lowest RMSE in an experiment?
- Exam domain
- Databricks Machine Learning36% of the exam
- Difficulty
- Medium
- In this mock
- 18 questions on this domainPractise this domain
Why the exam asks this
Databricks Machine Learning (36% of the exam)
Objective in the exam guide: Identify the best run using the MLflow Client API
Identifying the best run with the Client API is named.
Why D is the answer
client.search_runs(experiment_ids=[exp_id], order_by=["metrics.rmse ASC"], max_results=1)
search_runs filters and sorts runs. Ordering by metrics.rmse ascending with one result returns the best run.
Remember: search_runs sorted by the metric.
How it works
search_runs supports filtering and ordering by metrics.
In detail
- search_runs with order_by.
- ASC for lower-is-better metrics.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. client.get_run("best")WrongMost tempting
get_run needs a real run ID.
Why it tempts: It reads naturally but is not an API.
B. client.get_run(run_id="best").data.metrics["rmse"], which returns the lowest runWrong
log_metric writes, it does not search.
C. client.list_artifacts(exp_id)Wrong
list_artifacts lists files of a run.
D. client.search_runs(experiment_ids=[exp_id], order_by=["metrics.rmse ASC"], max_results=1)Right
search_runs sorted by the metric.
Use case
An illustrative scenario, not a real incident.
Illustrative: a nightly job picks the best of 40 tuning runs and registers it.
See it in different ways
flowchart LR S0["Get experiment ID"] --> S1["search_runs ordered by metric"] --> S2["Read run_id"] --> S3["Register"]
How to read this chart
- Read it in order: Get experiment ID, then search_runs ordered by metric, then Read run_id, then Register.
sequenceDiagram participant P0 as Script participant P1 as MlflowClient participant P2 as Tracking server P0->>P1: search_runs order_by rmse ASC P1->>P2: query P1-->>P0: best run
How to read this chart
- 1. Script sends "search_runs order_by rmse ASC" to MlflowClient.
- 2. MlflowClient sends "query" to Tracking server.
- 3. Script gets a reply from MlflowClient: "best run".