0
0
MLOpsdevops~10 mins

Data validation in CI pipeline 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 run data validation using Great Expectations in the CI pipeline.

MLOps
import great_expectations as ge
import pandas as pd
data = ge.dataset.PandasDataset(pd.read_csv('data.csv'))
results = data.[1]()
Drag options to blanks, or click blank then click option'
Avalidate
Brun
Ctest
Dcheck
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'check' or 'test' instead of 'validate' causes errors.
2fill in blank
medium

Complete the code to load the Great Expectations suite named 'my_suite' for validation.

MLOps
from great_expectations.data_context import DataContext
context = DataContext()
suite = context.get_expectation_suite('[1]')
Drag options to blanks, or click blank then click option'
Adefault_suite
Bvalidation_suite
Csuite1
Dmy_suite
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong suite name causes the pipeline to fail.
3fill in blank
hard

Fix the error in the command to run data validation in the CI pipeline using Great Expectations CLI.

MLOps
great_expectations [1] --suite my_suite --data-dir ./data
Drag options to blanks, or click blank then click option'
Atest
Bvalidate
Crun
Dcheck
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'check' or 'run' causes command not found errors.
4fill in blank
hard

Fill both blanks to create a Python dictionary comprehension that filters data rows where 'age' is greater than 18.

MLOps
filtered_data = {row['id']: row for row in data if row['[1]'] [2] 18}
Drag options to blanks, or click blank then click option'
Aage
B>
C<
Dscore
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' or wrong key filters incorrect data.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase 'name' to 'score' for scores above 50.

MLOps
result = [1]: [2] for item in data if item['score'] [3] 50
Drag options to blanks, or click blank then click option'
Aitem['name'].upper()
Bitem['score']
C>
Ditem['name']
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase names or wrong comparison operator.