0
0
ML Pythonml~10 mins

Experiment tracking (MLflow) in ML Python - Interactive Code Practice

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

Complete the code to start an MLflow experiment run.

ML Python
with mlflow.[1]():
    mlflow.log_param("param1", 5)
Drag options to blanks, or click blank then click option'
Astart_run
Brun_experiment
Cexperiment_start
Dbegin_run
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent function like mlflow.run_experiment()
Trying to call mlflow.experiment_start() which does not exist
2fill in blank
medium

Complete the code to log a metric value in MLflow.

ML Python
mlflow.[1]("accuracy", 0.95)
Drag options to blanks, or click blank then click option'
Alog_param
Blog_value
Clog_result
Dlog_metric
Attempts:
3 left
💡 Hint
Common Mistakes
Using mlflow.log_param() which is for parameters, not metrics
Trying to use mlflow.log_result() which does not exist
3fill in blank
hard

Fix the error in the code to set the experiment name in MLflow.

ML Python
mlflow.[1](experiment_name="MyExperiment")
Drag options to blanks, or click blank then click option'
Acreate_experiment
Bstart_experiment
Cset_experiment
Dexperiment_set
Attempts:
3 left
💡 Hint
Common Mistakes
Using mlflow.start_experiment() which does not exist
Trying mlflow.create_experiment() which requires an experiment name but is not for setting current experiment
4fill in blank
hard

Fill both blanks to log a parameter and a metric inside an MLflow run.

ML Python
with mlflow.start_run():
    mlflow.[1]("learning_rate", 0.01)
    mlflow.[2]("rmse", 1.23)
Drag options to blanks, or click blank then click option'
Alog_param
Blog_metric
Clog_result
Dlog_value
Attempts:
3 left
💡 Hint
Common Mistakes
Using log_metric for parameters or log_param for metrics
Trying to use non-existent functions like log_result
5fill in blank
hard

Fill all four blanks to create an MLflow run, log a parameter, a metric, and end the run.

ML Python
run = mlflow.[1]()
mlflow.[2]("batch_size", 32)
mlflow.[3]("accuracy", 0.89)
run.[4]()
Drag options to blanks, or click blank then click option'
Astart_run
Blog_param
Clog_metric
Dend_run
Attempts:
3 left
💡 Hint
Common Mistakes
Reusing start_run() to end the run instead of end_run()
Mixing up log_param and log_metric