0
0
MLOpsdevops~10 mins

Model approval workflows 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 approve a model version using MLflow.

MLOps
client = mlflow.tracking.MlflowClient()
client.[1](name="MyModel", version=1, stage="Production")
Drag options to blanks, or click blank then click option'
Adelete_model_version
Bget_model_version
Cregister_model
Dtransition_model_version_stage
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method that deletes or registers instead of transitioning stage.
2fill in blank
medium

Complete the code to fetch approved model versions.

MLOps
client = mlflow.tracking.MlflowClient()
model_versions = client.search_model_versions("name = 'MyModel'")
approved_versions = [mv for mv in model_versions if mv.[1] == 'Production']
Drag options to blanks, or click blank then click option'
Acurrent_stage
Bversion
Crun_id
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'version' or 'status' which do not represent the stage.
3fill in blank
hard

Fix the error in the code to reject a model version by moving it to 'Archived' stage.

MLOps
client = mlflow.tracking.MlflowClient()
client.transition_model_version_stage(name="MyModel", version=2, stage=[1])
Drag options to blanks, or click blank then click option'
AArchived
B"Rejected"
C"Archived"
DRejected
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted stage names causing syntax errors.
Using wrong stage names like 'Rejected'.
4fill in blank
hard

Fill both blanks to create a dictionary of model versions with their stages for 'MyModel'.

MLOps
client = mlflow.tracking.MlflowClient()
model_versions = client.search_model_versions("name = 'MyModel'")
version_stage_map = { [1]: mv.[2] for mv in model_versions }
Drag options to blanks, or click blank then click option'
Amv.version
Bmv.current_stage
Cmv.stage
Dmv.id
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attributes like 'mv.stage' or 'mv.id'.
5fill in blank
hard

Fill all three blanks to filter and list model versions in 'Staging' stage.

MLOps
client = mlflow.tracking.MlflowClient()
model_versions = client.search_model_versions("name = 'MyModel'")
staging_versions = [mv.[1] for mv in model_versions if mv.[2] == [3]]
Drag options to blanks, or click blank then click option'
Aversion
Bcurrent_stage
C"Staging"
Dstage
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong attributes or missing quotes around 'Staging'.