0
0
MLOpsdevops~10 mins

Performance metric tracking 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 metric named 'accuracy' with value 0.95 using MLflow.

MLOps
mlflow.log_metric('[1]', 0.95)
Drag options to blanks, or click blank then click option'
Aloss
Baccuracy
Cprecision
Drecall
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong metric name like 'loss' or 'precision'.
2fill in blank
medium

Complete the code to start an MLflow run before logging metrics.

MLOps
with mlflow.[1]():
    mlflow.log_metric('accuracy', 0.95)
Drag options to blanks, or click blank then click option'
Astart_run
Brun_start
Cbegin_run
Dopen_run
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names like 'run_start' or 'begin_run'.
3fill in blank
hard

Fix the error in the code to log the metric 'loss' with value 0.1 inside an MLflow run.

MLOps
with mlflow.start_run():
    mlflow.log_metric('loss', [1])
Drag options to blanks, or click blank then click option'
A0.1
B'0.1'
Closs
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number in quotes, which makes it a string.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that tracks metrics only if their value is greater than 0.5.

MLOps
metrics = {k: v for k, v in all_metrics.items() if v [1] [2]
Drag options to blanks, or click blank then click option'
A>
B0.5
C<
D1.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' or wrong threshold values.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of metrics where keys are uppercase and values are above 0.7.

MLOps
filtered_metrics = [1]: v for k, v in metrics.items() if v [2] [3]
Drag options to blanks, or click blank then click option'
Ak.upper()
B>
C0.7
Dk.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase keys or wrong comparison operators.