Certified Machine Learning Professional Exam QuestionsBrowse all questions from this exam

Certified Machine Learning Professional Exam - Question 3


A data scientist is using MLflow to track their machine learning experiment. As a part of each MLflow run, they are performing hyperparameter tuning. The data scientist would like to have one parent run for the tuning process with a child run for each unique combination of hyperparameter values.

They are using the following code block:

The code block is not nesting the runs in MLflow as they expected.

Which of the following changes does the data scientist need to make to the above code block so that it successfully nests the child runs under the parent run in MLflow?

Show Answer
Correct Answer: AE

In order to nest the child runs under the parent run, the child run blocks need to be indented within the parent run block. This way, the child runs are executed within the context of the parent run, allowing MLflow to correctly nest the runs.

Discussion

7 comments
Sign in to comment
BokNinjaOption: A
Dec 19, 2023

A. Indent the child run blocks within the parent run block

mozucaOption: A
Dec 27, 2023

The answer is A since the correct sintax is: with mlflow.start_run(run_name="Nested Example") as run: # Create nested run with nested=True argument with mlflow.start_run(run_name="Child 1", nested=True): mlflow.log_param("run_name", "child_1") with mlflow.start_run(run_name="Child 2", nested=True): mlflow.log_param("run_name", "child_2")

random_data_guyOption: A
Dec 27, 2023

A should be correct - see https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.start_run for an example (where nested=True is added to children runs + they have different names)

hugodscarvalhoOption: A
Jan 27, 2024

Doc: https://www.restack.io/docs/mlflow-knowledge-mlflow-nested-run-example

c4b65b5Option: A
Jun 11, 2024

A is correct

sindhu_gowdaOption: A
Jun 11, 2024

A is correct

zafarsohaibOption: A
Jun 17, 2024

A should be the correct answer.