Databricks Machine Learning Professional Question 42
Select 3You are building a machine learning pipeline in Databricks and need to track nested runs to monitor the performance of multiple models within a single experiment. Which of the following are requirements to properly track nested runs using MLflow in Databricks?
- A
The parent run must be started before any nested runs.
- B
Each nested run must be explicitly ended with an
end_run()call. - C
You must assign a unique experiment ID to each nested run.
- D
The parent run must remain active while nested runs are being executed.
- E
Nested runs can only be created in separate Databricks notebooks.
Show answer and explanation
Correct answers: A, B, D
Explanation
Tracking nested runs in Databricks using MLflow requires starting a parent run before any nested runs to establish the tracking hierarchy. Each nested run must be explicitly closed with end_run() to ensure proper tracking and resource management. Additionally, the parent run must remain active while nested runs are being executed to maintain the context. Unique experiment IDs and separate notebooks are not necessary for tracking nested runs.
- A. Correct.
Correct. A parent run must be started using
mlflow.start_run()before any nested runs can be tracked, as nested runs are associated with the active parent run. - B. Correct.
Correct. Each nested run needs to be explicitly ended using
mlflow.end_run()to ensure proper tracking and resource management. - C. Incorrect.
Incorrect. Nested runs do not require unique experiment IDs as they are tracked within the same experiment as the parent run.
- D. Correct.
Correct. The parent run must remain active while nested runs are being executed because nested runs are linked to the parent run's context.
- E. Incorrect.
Incorrect. Nested runs can be created in the same notebook or script as the parent run; they do not require separate Databricks notebooks.