0
0
MLOpsdevops~10 mins

Regulatory compliance (GDPR, AI Act) 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 user consent before processing data.

MLOps
if user.has_given_[1]():
    process_data(user.data)
Drag options to blanks, or click blank then click option'
Aconsent
Bagreement
Cpermission
Dapproval
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'approval' or 'permission' which are not the exact GDPR term.
2fill in blank
medium

Complete the code to anonymize data before storage.

MLOps
def anonymize(data):
    return data.[1]()
Drag options to blanks, or click blank then click option'
Ahash
Bencrypt
Ccompress
Dserialize
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'encrypt' which can be reversed, not anonymized.
3fill in blank
hard

Fix the error in the compliance check function.

MLOps
def check_compliance(data):
    if data.get('age') [1] 16:
        return False
    return True
Drag options to blanks, or click blank then click option'
A<
B>=
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' which rejects compliant users.
4fill in blank
hard

Fill both blanks to filter AI model logs for GDPR compliance.

MLOps
filtered_logs = {entry: logs[entry] for entry in logs if logs[entry].get('user_id') [1] None and logs[entry].get('consent') [2] True}
Drag options to blanks, or click blank then click option'
Ais not
B==
C!=
Dis
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'is' instead of 'is not' for None check.
5fill in blank
hard

Fill all three blanks to create a dictionary of user data complying with AI Act transparency rules.

MLOps
user_data = [1]: [2] for [3] in raw_data if raw_data[[3]].get('consent')
Drag options to blanks, or click blank then click option'
Auser_id
Binfo
Cuser
Ddata
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing variable names causing syntax errors.