Courseiva
Model Development →easyMultiple Choice

Databricks-ML-Assoc Model Development Practice Question

A data scientist is developing a model on Databricks and wants to use MLflow to track experiments. They create a new experiment using mlflow.create_experiment('my_experiment') and then run mlflow.start_run(). However, when they log parameters and metrics, they notice that the run is not associated with 'my_experiment' but with the default experiment. What is the most likely reason?

⚠ Common exam trap

The trap here is assuming that creating an experiment also makes it the active one, when in fact you must set it explicitly.

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

✓

The mlflow.create_experiment() function only creates the experiment but does not set it as the active experiment; they must call mlflow.set_experiment() to use it.

Creating an experiment with mlflow.create_experiment() does not automatically set it as the active experiment for subsequent runs. You must explicitly call mlflow.set_experiment() to designate the experiment for logging. Otherwise, runs default to the notebook's experiment or the default experiment. This separation allows flexible experiment management but requires an extra step.

Answer analysis

Option-by-option breakdown

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

  • ✗

    The experiment was created in a different workspace, so the run cannot be associated with it.

    Why it's wrong here

    The scenario does not suggest a different workspace; the data scientist is working in the same Databricks environment. If the experiment were in a different workspace, they would need to use the appropriate tracking URI, but that is not mentioned. The most straightforward explanation is that they did not set the experiment as active. Workspace mismatch is an unlikely and unsupported cause here.

  • ✗

    The mlflow.start_run() function requires an experiment_id argument to associate the run with a specific experiment; without it, the run goes to the default experiment.

    Why it's wrong here

    While mlflow.start_run() does accept an experiment_id parameter, it is not required. If omitted, it uses the active experiment set by mlflow.set_experiment(). The problem is that the active experiment was never set to 'my_experiment'. Therefore, the absence of experiment_id is not the root cause; the failure to set the active experiment is.

  • ✗

    The experiment name 'my_experiment' is invalid because it contains an underscore; MLflow experiment names must be alphanumeric.

    Why it's wrong here

    MLflow experiment names can contain underscores and many other characters; there is no restriction to alphanumeric only. The issue is not the name but the failure to set the experiment as active. Therefore, this is not the cause. Underscores are perfectly valid in experiment names and are commonly used.

  • ✓

    The mlflow.create_experiment() function only creates the experiment but does not set it as the active experiment; they must call mlflow.set_experiment() to use it.

    Why this is correct

    This is correct because mlflow.create_experiment() creates a new experiment and returns its ID, but it does not change the active experiment. To log runs to that experiment, you must call mlflow.set_experiment() with the experiment name or ID. Without that, mlflow.start_run() uses the default experiment (usually the notebook's experiment). This is a common mistake when setting up experiments programmatically.

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.