Courseiva
Model Development →mediumMultiple Choice

Databricks-ML-Assoc Model Development Practice Question

A machine learning engineer is building a scikit-learn model with hyperparameter tuning on Databricks. They want each trial to be tracked as a nested run under a single parent run in MLflow so that all trials are grouped together and the best parameters can be compared easily. Which MLflow API call should they use to start each trial run so that it is nested under the currently active run?

⚠ Common exam trap

Test-takers frequently confuse experiment creation or manual tagging with nested run creation, when MLflow provides a dedicated nested parameter on start_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

✓

mlflow.start_run(nested=True)

Nested runs are created by calling mlflow.start_run with nested=True while a parent run is active. This groups all trial runs under one parent, making it easy to compare metrics and select the best hyperparameters. Other MLflow APIs either create separate experiments or log artifacts, and manually setting parentRunId is not the supported nesting mechanism.

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.set_tag("mlflow.parentRunId", parent_id)

    Why it's wrong here

    Manually setting the mlflow.parentRunId tag can technically link runs, but it is not the intended API for creating nested runs and requires an existing parent run ID. It bypasses the automatic nesting logic and can lead to inconsistent metadata. The correct approach is to use start_run(nested=True) within the active parent context, which handles parent linkage and lifecycle correctly.

  • ✓

    mlflow.start_run(nested=True)

    Why this is correct

    Using start_run with nested=True creates a child run under the active parent run, keeping trial metrics and parameters grouped. This is the standard MLflow pattern for hyperparameter tuning, where the parent run represents the overall tuning job and each trial is a nested run that can be compared and selected. The child run inherits the parent's experiment and tags, and the UI displays the hierarchy clearly.

  • ✗

    mlflow.log_artifact()

    Why it's wrong here

    log_artifact uploads a file to the current run's artifact store; it does not create or nest runs. It is used for storing model files, plots, or other outputs. It has no effect on run hierarchy, so it cannot satisfy the requirement of grouping trials under a parent run. The engineer needs a run-creation API, not an artifact-logging API.

  • ✗

    mlflow.create_experiment()

    Why it's wrong here

    create_experiment creates a new experiment, not a nested run. It would separate trials into different experiments, breaking the grouping requirement. This call is used to initialize an experiment with a name and artifact location, and it does not establish a parent-child relationship between runs. Using it here would prevent the engineer from comparing trials under a single parent run.

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.