0
0
MLOpsdevops~10 mins

Cost allocation and optimization 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 set a budget alert threshold at 80%.

MLOps
budget_alert = BudgetAlert(threshold= [1])
Drag options to blanks, or click blank then click option'
A0.8
B80
C8
D1.2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 80 instead of 0.8
Using values greater than 1
2fill in blank
medium

Complete the code to filter cost data for the current month.

MLOps
filtered_costs = costs.filter(date__month= [1])
Drag options to blanks, or click blank then click option'
A12
Bcurrent_month
C30
Ddatetime.now().month
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of an integer
Hardcoding the month number
3fill in blank
hard

Fix the error in the code to calculate cost per model deployment.

MLOps
cost_per_deployment = total_cost [1] number_of_deployments
Drag options to blanks, or click blank then click option'
A/
B*
C+
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication instead of division
Using addition or subtraction
4fill in blank
hard

Fill both blanks to create a dictionary of model costs filtered by cost greater than 100.

MLOps
model_costs = {model: cost [1] model, cost in cost_data.items() if cost [2] 100}
Drag options to blanks, or click blank then click option'
Afor
B==
C>
Din
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '>' for filtering
Using 'in' instead of 'for' in comprehension
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of model costs where cost is less than 500 and keys are uppercase.

MLOps
filtered_costs = [1]: cost for [2], cost in costs.items() if cost [3] 500
Drag options to blanks, or click blank then click option'
Amodel.upper()
Bmodel
C<
Dcost
Attempts:
3 left
💡 Hint
Common Mistakes
Using cost as key instead of model
Using '>' instead of '<' for filtering