0
0
MLOpsdevops~10 mins

Model metadata and lineage 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 log model metadata using MLflow.

MLOps
import mlflow
mlflow.[1]("learning_rate", 0.01)
Drag options to blanks, or click blank then click option'
Amodels
Bset_tag
Clog_param
Dstart_run
Attempts:
3 left
💡 Hint
Common Mistakes
Using start_run instead of log_param.
Trying to log parameters with models module.
2fill in blank
medium

Complete the code to start an MLflow run for tracking.

MLOps
with mlflow.[1]():
    mlflow.log_metric("accuracy", 0.95)
Drag options to blanks, or click blank then click option'
Aexperiment
Blog_metric
Crun
Dstart_run
Attempts:
3 left
💡 Hint
Common Mistakes
Using log_metric as a context manager.
Using experiment which is not a context manager.
3fill in blank
hard

Fix the error in the code to register a model in MLflow Model Registry.

MLOps
mlflow.[1]("runs:/12345/model", "MyModel")
Drag options to blanks, or click blank then click option'
Aregister_model
Blog_model
Cmodels
Dstart_run
Attempts:
3 left
💡 Hint
Common Mistakes
Using log_model which does not exist.
Using start_run which is unrelated.
4fill in blank
hard

Fill both blanks to create a dictionary capturing model metadata and lineage.

MLOps
metadata = {"model_name": [1], "source_run_id": [2]
Drag options to blanks, or click blank then click option'
A"MyModel"
B"12345"
C"run_67890"
D"ModelV1"
Attempts:
3 left
💡 Hint
Common Mistakes
Using numeric values instead of strings.
Mixing up model name and run ID.
5fill in blank
hard

Fill all three blanks to log model metadata with tags and parameters.

MLOps
mlflow.start_run()
mlflow.set_tag("[1]", "v1.0")
mlflow.log_param("[2]", 100)
mlflow.log_metric("[3]", 0.98)
Drag options to blanks, or click blank then click option'
Aversion
Bnum_trees
Caccuracy
Dstage
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing tags with parameters or metrics.
Using incorrect keys that MLflow does not recognize.