0
0
MLOpsdevops~10 mins

Why experiment tracking prevents wasted work in MLOps - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start tracking an experiment run using MLflow.

MLOps
with mlflow.start_run() as [1]:
    mlflow.log_param("learning_rate", 0.01)
Drag options to blanks, or click blank then click option'
Atracker
Bexperiment
Csession
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated variable names like 'experiment' or 'session' which do not represent the run context.
2fill in blank
medium

Complete the code to log a metric called 'accuracy' with value 0.95 in MLflow.

MLOps
mlflow.log_metric("accuracy", [1])
Drag options to blanks, or click blank then click option'
A0.95
B0.85
C1.0
D0.75
Attempts:
3 left
💡 Hint
Common Mistakes
Logging incorrect metric values like 0.85 or 1.0 which do not match the intended accuracy.
3fill in blank
hard

Fix the error in the code to set the experiment name before starting a run.

MLOps
mlflow.[1]("MyExperiment")
with mlflow.start_run():
    mlflow.log_param("batch_size", 32)
Drag options to blanks, or click blank then click option'
Aset_experiment_name
Bcreate_experiment
Cset_experiment
Dstart_experiment
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent functions like 'set_experiment_name' or 'start_experiment'.
4fill in blank
hard

Fill both blanks to create a dictionary of parameters and log them in MLflow.

MLOps
params = {"epochs": [1], "dropout": [2]
mlflow.log_params(params)
Drag options to blanks, or click blank then click option'
A10
B0.3
C5
D0.5
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping values or using incorrect types like strings instead of numbers.
5fill in blank
hard

Fill all three blanks to filter experiment runs with accuracy greater than 0.9.

MLOps
runs = mlflow.search_runs(filter_string="metrics.accuracy [1] [2]")
high_acc_runs = [run for run in runs.itertuples() if run.metrics_accuracy [3] 0.9]
Drag options to blanks, or click blank then click option'
A>=
B>
C0.9
D0.8
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>=' or wrong threshold values like 0.8 which change the filter meaning.