0
0
MLOpsdevops~10 mins

Logging artifacts and models 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 a model artifact using MLflow.

MLOps
import mlflow
mlflow.[1].log_model(model, "model")
Drag options to blanks, or click blank then click option'
Alog
Btracking
Cmodels
Dpyfunc
Attempts:
3 left
💡 Hint
Common Mistakes
Using mlflow.log instead of mlflow.pyfunc.log_model
Trying to log model directly without specifying the module
2fill in blank
medium

Complete the code to log an artifact file in MLflow.

MLOps
with mlflow.start_run():
    mlflow.[1]("output.txt")
Drag options to blanks, or click blank then click option'
Atracking
Blog
Clog_artifact
Dmodels
Attempts:
3 left
💡 Hint
Common Mistakes
Using mlflow.log_param instead of mlflow.log_artifact
Trying to log artifact outside a run context
3fill in blank
hard

Fix the error in the code to log a model with MLflow.

MLOps
mlflow.[1].log_model(model, "model")
Drag options to blanks, or click blank then click option'
Asklearn
Bmodels
Cpyfunc
Dartifacts
Attempts:
3 left
💡 Hint
Common Mistakes
Calling mlflow.log_model directly without module
Using mlflow.artifacts to log models
4fill in blank
hard

Fill both blanks to log a model and an artifact inside a run.

MLOps
with mlflow.[1]():
    mlflow.sklearn.[2](model, "model")
Drag options to blanks, or click blank then click option'
Astart_run
Blog_model
Clog_artifact
Dend_run
Attempts:
3 left
💡 Hint
Common Mistakes
Not starting a run before logging
Using log_artifact to log models
5fill in blank
hard

Fill all three blanks to log a model, an artifact, and end the run properly.

MLOps
mlflow.[1]()
mlflow.sklearn.[2](model, "model")
mlflow.[3]("output.txt")
Drag options to blanks, or click blank then click option'
Astart_run
Blog_model
Clog_artifact
Dend_run
Attempts:
3 left
💡 Hint
Common Mistakes
Logging without starting a run
Confusing log_model and log_artifact methods