0
0
MLOpsdevops~10 mins

MLflow setup and basics in MLOps - 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 the MLflow tracking server locally.

MLOps
mlflow [1]
Drag options to blanks, or click blank then click option'
Astart
Brun
Cserver
Dui
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' instead of 'ui' starts an MLflow project run, not the server.
Using 'server' requires --backend-store-uri and other flags; 'start' is not a valid MLflow command.
2fill in blank
medium

Complete the code to log a parameter named 'alpha' with value 0.5 in MLflow.

MLOps
mlflow.log_param('[1]', 0.5)
Drag options to blanks, or click blank then click option'
Alearning_rate
Blambda
Calpha
Dbeta
Attempts:
3 left
💡 Hint
Common Mistakes
Using other parameter names like 'beta' or 'lambda' instead of 'alpha'.
Forgetting to put the parameter name in quotes.
3fill in blank
hard

Fix the error in the code to start an MLflow run context.

MLOps
with mlflow.[1]():
    print('Running experiment')
Drag options to blanks, or click blank then click option'
Astart_run
Brun_start
Cbegin_run
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' or 'begin_run' which are not valid MLflow methods.
Swapping the order of words in the method name.
4fill in blank
hard

Fill both blanks to log a metric named 'accuracy' with value 0.95 inside an MLflow run.

MLOps
with mlflow.[1]():
    mlflow.[2]('accuracy', 0.95)
Drag options to blanks, or click blank then click option'
Astart_run
Blog_metric
Clog_param
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using log_param instead of log_metric for metrics.
Using run instead of start_run to start the run.
5fill in blank
hard

Fill all three blanks to create an MLflow experiment named 'MyExperiment' and set it as active.

MLOps
mlflow.[1]('MyExperiment')
experiment_id = mlflow.[2]('MyExperiment').experiment_id
mlflow.[3](experiment_id)
Drag options to blanks, or click blank then click option'
Acreate_experiment
Bget_experiment_by_name
Cset_experiment
Dstart_run
Attempts:
3 left
💡 Hint
Common Mistakes
Using start_run instead of create_experiment or set_experiment.
Confusing get_experiment_by_name with set_experiment.