Courseiva
ML Workflows →easyMultiple Choice

Databricks-ML-Assoc ML Workflows Practice Question

A data scientist wants to track the progress of a training script that runs for several hours on a Databricks cluster. The script uses MLflow and needs to record metrics such as loss and accuracy at the end of each epoch so they can be visualized in real time. Which MLflow API call should be used inside the training loop?

⚠ Common exam trap

Many candidates confuse parameters, artifacts, and tags with metrics; only mlflow.log_metric produces the numeric time-series data that MLflow charts over steps or time.

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

✓

mlflow.log_metric

To record metrics like loss and accuracy at each epoch for real-time visualization, the training loop should call mlflow.log_metric. This API accepts a metric name, a numeric value, and an optional step, and MLflow stores each call as a data point. The MLflow UI plots these points as a time-series chart, allowing progress monitoring during long training runs.

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.log_param

    Why it's wrong here

    mlflow.log_param records a single parameter value, such as learning rate or batch size, and is intended for configuration settings, not time-series metrics. It cannot capture multiple values over epochs, and the MLflow UI will not plot it as a metric curve. Using it inside the training loop would overwrite or conflict with existing parameters and fail to show progress.

  • ✗

    mlflow.set_tag

    Why it's wrong here

    mlflow.set_tag attaches a string key-value pair to the run for categorization and search. Tags are not numeric and are not plotted over time. Using set_tag inside the training loop would only overwrite the tag with the latest value and provide no curve of loss or accuracy, so it cannot satisfy the requirement for real-time metric visualization.

  • ✓

    mlflow.log_metric

    Why this is correct

    mlflow.log_metric logs a numeric value for a named metric and can be called repeatedly with the same metric name, optionally specifying a step. MLflow stores each value with its timestamp and step, enabling the UI to render a live-updating chart of loss and accuracy per epoch. This is the standard way to track training progress in real time.

  • ✗

    mlflow.log_artifact

    Why it's wrong here

    mlflow.log_artifact uploads a file, such as a plot or a model file, to the run's artifact store. It does not record numeric values that MLflow can chart. While you could write metrics to a file and log it, that approach is indirect and does not provide real-time metric visualization in the MLflow UI, which expects metrics logged via the metrics API.

About these practice questions

Courseiva writes every Databricks-ML-Assoc question from scratch — 319 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 →

How Courseiva writes practice questions · Editorial policy

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-Assoc 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-Assoc exam.