Courseiva
Model Development →mediumMultiple Choice

Databricks-ML-Pro Model Development Practice Question

A data scientist is training a scikit-learn model on Databricks and wants to capture the best hyperparameters found during a hyperparameter sweep. They are using MLflow Tracking with nested runs. Which approach correctly records the best parameters and metrics in the parent run?

⚠ Common exam trap

The trap here is assuming that MLflow automatically aggregates or propagates the best results from nested runs to the parent run.

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

✓

Log the best parameters and metrics directly in the parent run using `mlflow.log_params()` and `mlflow.log_metrics()` after the sweep completes.

In MLflow, nested runs allow you to organize hyperparameter sweeps. The parent run acts as a container, and child runs log individual trials. To capture the best parameters and metrics in the parent, you must explicitly log them after the sweep. MLflow does not auto-propagate, so manual logging in the parent run is required.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Set the parent run's status to 'FINISHED' and then use `mlflow.log_artifact()` to attach a JSON file containing the best parameters.

    Why it's wrong here

    While logging an artifact is possible, it does not directly record parameters and metrics as first-class MLflow entities. The question asks for recording best parameters and metrics, which are better stored via `log_params` and `log_metrics` for easy querying and comparison in the MLflow UI.

  • ✗

    Use `mlflow.log_params()` inside each child run and rely on MLflow to automatically propagate the best parameters to the parent run.

    Why it's wrong here

    MLflow does not automatically propagate parameters from child runs to the parent run. Each nested run is independent; logging in a child run only affects that child. The parent run will not receive the best parameters unless explicitly logged, so this approach fails to capture the summary in the parent.

  • ✓

    Log the best parameters and metrics directly in the parent run using `mlflow.log_params()` and `mlflow.log_metrics()` after the sweep completes.

    Why this is correct

    This approach works because nested runs are children of the parent run; after all child runs finish, the parent run can log the aggregated best parameters and metrics using standard MLflow logging functions. It ensures the parent run contains a summary of the best configuration, which is useful for comparison and model selection.

  • ✗

    Use `mlflow.start_run(nested=True)` for the parent run and `mlflow.start_run()` for child runs, then log the best parameters in the parent run.

    Why it's wrong here

    Nested runs are created with `nested=True` for child runs, not the parent. The parent run should be started normally, and child runs use `nested=True`. This option reverses the nesting, which would cause an error or incorrect hierarchy, so it does not achieve the goal.

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 →

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