Databricks-ML-Pro Model Development Practice Question
Exhibit
MLflow Run Output:
Run ID: 550e8400-e29b-41d4-a716-446655440000
Status: FINISHED
Parameters: {'learning_rate': '0.01', 'epochs': '50'}
Metrics: {'accuracy': '0.88', 'loss': '0.12'}
Tags: {'mlflow.user': 'databricks_user', 'mlflow.source.name': 'train_script.py'}Refer to the exhibit. A user wants to retrieve the 'accuracy' metric from this run programmatically. Which code snippet correctly accesses this value?
⚠ Common exam trap
Candidates frequently confuse client-side API methods with fluent API calls, or incorrectly attempt to access metrics via dictionary syntax directly on the client object.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
client = mlflow.tracking.MlflowClient(); client.get_run('550e8400-e29b-41d4-a716-446655440000').data.metrics['accuracy']
The MLflow tracking client provides the `get_run` method, which returns an object containing all run metadata, including metrics. Accessing the dictionary via `data.metrics` is the standard way to retrieve tracked values. This is critical for automated model comparison scripts, where developers must programmatically evaluate multiple runs to select the best-performing iteration for registration in the Model Registry.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
mlflow.get_metric('accuracy', run_id='550e8400-e29b-41d4-a716-446655440000')
Why it's wrong here
The MLflow API does not have a top-level `get_metric` function that accepts a run ID directly in this manner. Metrics are nested within the run data object, and the tracking client must be instantiated to query the backend store for the specific run's results.
- ✓
client = mlflow.tracking.MlflowClient(); client.get_run('550e8400-e29b-41d4-a716-446655440000').data.metrics['accuracy']
Why this is correct
This method correctly instantiates the tracking client, retrieves the specific run object using its unique identifier, and accesses the nested metrics dictionary. This pattern is essential for developers building custom dashboards or automated model evaluation pipelines that need to extract specific performance data from historical MLflow runs.
- ✗
mlflow.search_runs(run_ids=['550e8400-e29b-41d4-a716-446655440000'])['accuracy']
Why it's wrong here
The `search_runs` function returns a pandas DataFrame, not a direct dictionary access. Accessing a column named 'accuracy' directly from the list returned by the search function will raise a KeyError, as the metrics are stored within the 'data' structure of the run entity.
- ✗
mlflow.load_metric('accuracy', '550e8400-e29b-41d4-a716-446655440000')
Why it's wrong here
There is no `load_metric` function in the MLflow Python API. Metrics are fundamentally part of the run metadata and are retrieved via the `MlflowClient` or the `mlflow.get_run` interface, which provides a structured way to access parameters, tags, and performance metrics for specific experiments.
About these practice questions
This Databricks-ML-Pro question is part of Courseiva's 300-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-ML-Pro practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-ML-Pro exam.