Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to deploy two model versions for A/B testing.
MLOps
deploy_model(version='[1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'latest' instead of a specific version
Deploying only one version
✗ Incorrect
The code deploys model version 'v2' for A/B testing.
2fill in blank
mediumComplete the code to route 30% of traffic to model version v2.
MLOps
set_traffic_split({'v1': 70, '[1]': 30}) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'v1' for 30% which is already 70%
Using undefined version names
✗ Incorrect
Traffic is split with 30% going to version 'v2' for testing.
3fill in blank
hardFix the error in the code to correctly log A/B test results.
MLOps
log_results(test_name='AB_Test_1', results=[1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined variable names
Typos in variable names
✗ Incorrect
The variable 'results_data' holds the test results to log.
4fill in blank
hardFill both blanks to create a dictionary mapping model versions to their accuracy scores.
MLOps
accuracy_scores = {'[1]': 0.85, '[2]': 0.90} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using versions not deployed
Using the same version twice
✗ Incorrect
The dictionary maps 'v1' and 'v2' to their accuracy scores for comparison.
5fill in blank
hardFill all three blanks to filter test results for version 'v2' with accuracy above 0.88.
MLOps
filtered_results = {k: v for k, v in results.items() if k == '[1]' and v [2] [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong version key
Using wrong comparison operator
Using incorrect threshold
✗ Incorrect
This code filters results to only include version 'v2' with accuracy greater than 0.88.