Databricks Machine Learning Professional Question 43
Select 3A data scientist is working on a machine learning experiment in Databricks that involves training multiple models within a single workflow. They want to track runs for each model separately while keeping them organized under a single parent run. Which of the following requirements must be met to successfully track nested runs in Databricks?
- A
The
mlflow.start_run()function must be called with thenested=Trueparameter for child runs. - B
The parent run must be explicitly ended before starting any nested runs.
- C
The MLflow experiment must be set using
mlflow.set_experiment()before starting the parent run. - D
MLflow must be configured to use a tracking server, either local or remote.
- E
The parent run ID must be manually passed when starting each child run.
Show answer and explanation
Correct answers: A, C, D
Explanation
To track nested runs in Databricks using MLflow, it is essential to configure the tracking environment properly by setting the experiment with mlflow.set_experiment() and ensuring MLflow is connected to a tracking server. When starting child runs, the nested=True parameter must be specified in mlflow.start_run() to designate them as nested. The parent run can remain active while nested runs are tracked. MLflow automatically manages relationships between parent and child runs, so manually passing parent run IDs is not required.
- A. Correct.
Correct: To enable nested runs in MLflow, the
nested=Trueparameter must be passed when callingmlflow.start_run()for child runs. - B. Incorrect.
Incorrect: The parent run does not need to be explicitly ended before starting nested runs. Nested runs can be tracked while the parent run is still active.
- C. Correct.
Correct: Setting the experiment using
mlflow.set_experiment()ensures that all runs, including nested runs, are associated with the correct MLflow experiment. - D. Correct.
Correct: MLflow must be properly configured with a tracking server (local or remote) to store and manage tracking information, including nested runs.
- E. Incorrect.
Incorrect: The parent run ID is automatically managed by MLflow when nested runs are created, so it does not need to be manually passed.