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?
Suggested Answer: E
Get Premium Databricks Machine Learning Professional Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
39 comments · newest first
SH
Shawnta
11 months ago
Wait, can you really nest runs like that? Sounds tricky!
SK
Skye
11 months ago
I think adding nested=True to the parent run is also a good idea.
LE
Lenna
12 months ago
You need to indent the child run blocks!
MI
Mitsue
12 months ago
Removing nested=True from child runs might help too.
GA
Galen
1 year ago
Totally agree, indentation is key here.
MA
Mari
1 year ago
Providing the same name for all runs seems off to me; I don't think that would help with nesting.
RO
Roslyn
1 year ago
I feel like the nested=True argument is crucial for the parent run, but I'm not sure if it needs to be removed from the child runs too.
RO
Royce
1 year ago
I think I saw a practice question where we had to use a nested argument, but I can't recall if it was for the parent or child runs.
HU
Huey
1 year ago
I remember something about indentation being important in Python, so maybe indenting the child run blocks could help?
MI
Micaela
1 year ago
I'm a little unsure about this one. The options all seem plausible, but I'm not confident which one is the right change to make. I'll need to review the MLflow documentation to make sure I understand the nesting behavior correctly.
AN
Annamae
1 year ago
Adding the nested=True argument to the parent run and removing it from the child runs sounds like a good strategy. That should help establish the proper hierarchy between the parent and child runs in MLflow.
NO
Novella
1 year ago
Okay, let me see. I'm guessing we need to indent the child run blocks within the parent run block to get the nesting right. That seems like the most straightforward solution.
EL
Elina
1 year ago
Hmm, I'm a bit confused. The code block doesn't seem to be nesting the runs as expected, but I'm not sure which change would fix that. I'll need to think through the options carefully.
DO
Dorethea
1 year ago
I think the key here is to properly nest the child runs under the parent run. Based on the options, I'd say adding the nested=True argument to the parent run and removing it from the child runs should do the trick.
MA
Malcolm
2 years ago
Hmm, I'm not sure. Maybe we should just print('Hello, World!') and call it a day.
JO
Joanne
1 year ago
User3: E) Add the nested=True argument to the parent run and remove the nested=True arguments from the child runs
VI
Vicente
1 year ago
User2: B) Add the nested=True argument to the parent run
JO
Josphine
2 years ago
User1: A) Indent the child run blocks within the parent run block
BE
Becky
2 years ago
But wouldn't adding the nested=True argument to the parent run also achieve the same result?
LU
Luis
2 years ago
This is a classic case of not following the MLflow documentation. Option E is the correct answer, no doubt about it.
FL
Flo
2 years ago
That makes sense, it will help nest the child runs under the parent run in MLflow.
ZA
Zachary
2 years ago
No, they should actually add the nested=True argument to the parent run and remove it from the child runs.
DA
Dan
2 years ago
I think the data scientist should add the nested=True argument to the parent run.
MA
Margot
2 years ago
I agree with Ammie. It makes sense to nest the child runs under the parent run.
KA
Katlyn
2 years ago
I think the key is to indent the child run blocks within the parent run block. That should do the trick. Option A is the way to go.
LO
Lorrie
1 year ago
Exactly, it's a small adjustment but it will make a big difference in organizing the runs.
TR
Tricia
1 year ago
Great, so the data scientist just needs to make that simple change in the code.
CH
Chanel
1 year ago
I agree, that's the key to nesting the child runs under the parent run in MLflow.
SH
Shawna
1 year ago
Option A is correct. Indenting the child run blocks within the parent run block will nest them properly.
AM
Ammie
2 years ago
I think the data scientist should indent the child run blocks within the parent run block.
RO
Rozella
2 years ago
The nested=True argument should be added to the parent run to nest the child runs under it. Option B looks good to me.
LE
Leatha
1 year ago
Good choice, let's update the code with nested=True for the parent run.
AD
Adelaide
1 year ago
Let's go with option B then.
DO
Dorcas
1 year ago
I agree, adding nested=True to the parent run should nest the child runs.
VA
Valentin
1 year ago
I think option B is the correct one.
TA
Talia
2 years ago
Great, let's make the change and see if it works.
SH
Shawna
2 years ago
That makes sense, let's go with option B then.
BO
Bong
2 years ago
I agree, adding nested=True to the parent run should nest the child runs.
AR
Arleen
2 years ago
I think option B is the correct one.