Databricks-ML-Pro Model Development Practice Question
An ML engineer is training a model with a custom Python loop and wants MLflow to capture training metrics at regular intervals so that partial progress is visible before the run finishes. They are using `mlflow.start_run` and manual logging. Which approach correctly makes intermediate metrics visible during the run?
⚠ Common exam trap
The trap here is assuming autolog or batched logging will surface custom-loop metrics mid-run, when only immediate per-step logging does.
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
✓
Call `mlflow.log_metric` inside the loop with the `step` argument set to the iteration number.
Intermediate visibility comes from persisting each metric as it is produced. Calling `log_metric` inside the loop writes the value immediately and the `step` argument positions it on the metric's time axis, producing a curve that updates live. Deferring logging to a single call at the end, or misusing tags, leaves no partial record if the run is interrupted.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable `mlflow.autolog()` and remove the manual logging calls from the loop.
Why it's wrong here
Autolog instruments supported frameworks and captures their internal callbacks; it does not understand a custom Python training loop. Removing manual calls would therefore stop the custom metrics from being recorded at all. Autolog cannot substitute for explicit logging inside bespoke training code.
- ✗
Accumulate metrics in a Python list and call `mlflow.log_metrics` once after the loop completes.
Why it's wrong here
Batching into a single `log_metrics` call at the end means nothing is persisted until training finishes. If the run crashes or is preempted, all intermediate values are lost, and no partial progress is visible. This defeats the requirement for metrics to appear during training.
- ✓
Call `mlflow.log_metric` inside the loop with the `step` argument set to the iteration number.
Why this is correct
`log_metric` writes the value immediately to the tracking server, and the `step` argument records the iteration index so the metric appears as a time series. Because each call persists right away, dashboards and the run page show progress while the loop is still executing, which is exactly the streaming visibility the engineer wants.
- ✗
Set the run tag `mlflow.note.content` inside the loop to the current metric value.
Why it's wrong here
Run tags are single string values attached to the run and are not designed to hold metric time series. Overwriting a tag each iteration keeps only the last value, provides no step axis, and cannot be charted as a metric curve, so it fails to deliver incremental progress tracking.
About these practice questions
Courseiva writes every Databricks-ML-Pro question from scratch — 300 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.