Databricks Machine Learning Associate Question 107
Select 2You are working on a machine learning project in Databricks and want to organize your MLflow tracking runs hierarchically. During a hyperparameter tuning experiment, you want to track each model training run as a nested run under a parent run. Which of the following actions must you take to create nested MLflow runs?
- A
Use
mlflow.start_run()with thenested=Trueparameter for child runs. - B
Ensure the parent run is active when starting a child run.
- C
Specify a unique experiment ID for each nested run using
mlflow.set_experiment(). - D
Manually assign a parent run ID when starting a nested run.
- E
End the parent run before starting any child runs to avoid conflicts.
Show answer and explanation
Correct answers: A, B
Explanation
To create nested MLflow runs, the parent run must be active, and you must use mlflow.start_run() with the nested=True parameter for child runs. This ensures that the child runs are properly tracked as part of the parent run, allowing for better organization and tracking of experiments.
- A. Correct.
mlflow.start_run()with thenested=Trueparameter allows you to mark a run as nested under the currently active parent run. This is the correct way to create nested runs in MLflow. - B. Correct.
The parent run must be active (started but not ended) when starting a nested run. If the parent run is not active, MLflow cannot establish the hierarchical relationship.
- C. Incorrect.
mlflow.set_experiment()sets the experiment context but is not related to defining nested runs. Nested runs are managed under the currently active parent run, not at the experiment level. - D. Incorrect.
You do not need to manually assign a parent run ID. MLflow automatically associates the nested run to the active parent run when
nested=Trueis used. - E. Incorrect.
The parent run must remain active to establish nested runs. Ending the parent run before starting a child run will break the hierarchical tracking structure.