Databricks-ML-Assoc Model Development Practice Question
A machine learning engineer is using MLflow on Databricks to track experiments for a fraud detection model. They notice that runs from two different team members are being logged into the same experiment, but the engineer wants to ensure that all runs from the current notebook session are automatically associated with a specific experiment. Which MLflow API call should the engineer use to set the active experiment for the current session?
⚠ Common exam trap
Candidates often confuse setting the tracking URI with setting the active experiment; the former only points to the tracking server, not the specific experiment.
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.set_experiment("/Shared/fraud-detection")
The correct API is mlflow.set_experiment, which sets the active experiment for the current session. This ensures that all subsequent runs are logged to the specified experiment without needing to pass the experiment ID to each run. It is the standard way to organize runs by project or team in Databricks.
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.start_run(experiment_id="12345")
Why it's wrong here
This starts a run in the experiment with the given ID, but it does not set a session-wide active experiment. Each subsequent start_run would need to specify the experiment_id again. The engineer wants automatic association for all runs in the session, so this is insufficient and error-prone. It also requires knowing the experiment ID upfront, which may not be readily available.
- ✗
mlflow.set_tracking_uri("databricks")
Why it's wrong here
This sets the tracking URI to the Databricks workspace, enabling MLflow to log to Databricks. However, it does not specify which experiment to use. Without setting the experiment, runs would go to the default experiment (usually the notebook's experiment). This does not meet the requirement of directing runs to a specific experiment.
- ✗
mlflow.create_experiment("/Shared/fraud-detection")
Why it's wrong here
This creates a new experiment with the given name and returns its ID. It does not set the created experiment as active. After creation, the engineer would still need to call set_experiment to use it. Therefore, this alone does not ensure subsequent runs are logged to that experiment, and it may fail if the experiment already exists.
- ✓
mlflow.set_experiment("/Shared/fraud-detection")
Why this is correct
This call sets the active experiment for the current session, so subsequent runs are logged there. It is the correct API to associate runs with a specific experiment path. The scenario requires ensuring all runs from the session go to a designated experiment, and set_experiment achieves that without needing to pass the experiment ID to each start_run call.
About these practice questions
This Databricks-ML-Assoc question is part of Courseiva's 319-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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-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.