0
0
MLOpsdevops~10 mins

Why containers make ML deployment portable in MLOps - Test Your Understanding

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

Complete the code to start a Docker container running an ML model.

MLOps
docker run -d --name ml_model [1] my_ml_image
Drag options to blanks, or click blank then click option'
A-v /data:/data
B-p 5000:5000
C--rm
D-it
Attempts:
3 left
💡 Hint
Common Mistakes
Using -v instead of -p to expose ports.
2fill in blank
medium

Complete the command to build a Docker image for your ML model.

MLOps
docker build -t [1] .
Drag options to blanks, or click blank then click option'
Aml_model_image
Brun_ml_model
Cstart_container
Ddeploy_model
Attempts:
3 left
💡 Hint
Common Mistakes
Using a command name instead of an image tag.
3fill in blank
hard

Fix the error in the Dockerfile line to set the working directory.

MLOps
WORKDIR [1]
Drag options to blanks, or click blank then click option'
Aapp
Bapp/
C/app
D./app
Attempts:
3 left
💡 Hint
Common Mistakes
Using relative paths instead of absolute paths.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps model names to their versions if version is greater than 1.

MLOps
{model: version [1] model_list if version [2] 1}
Drag options to blanks, or click blank then click option'
Afor
B>
C<
Din
Attempts:
3 left
💡 Hint
Common Mistakes
Using < instead of > in the condition.
5fill in blank
hard

Fill all three blanks to filter and transform a list of model names to uppercase if they start with 'a'.

MLOps
[[1].upper() for [2] in models if [3].startswith('a')]
Drag options to blanks, or click blank then click option'
Amodel
Bmodels
Dm
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names in the loop and condition.