Challenge - 5 Problems
A/B Testing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Purpose of A/B Testing in Machine Learning
What is the main goal of performing A/B testing when comparing two machine learning models?
Attempts:
2 left
💡 Hint
Think about how A/B testing helps in decision making with live data.
✗ Incorrect
A/B testing compares two models by exposing them to real users or data to see which performs better on key metrics.
❓ Predict Output
intermediate2:00remaining
Output of A/B Test Metric Calculation
Given the following Python code that calculates conversion rates for two models in an A/B test, what is the printed output?
ML Python
model_a_conversions = 120 model_a_visitors = 1000 model_b_conversions = 150 model_b_visitors = 1200 conversion_rate_a = model_a_conversions / model_a_visitors conversion_rate_b = model_b_conversions / model_b_visitors print(f"Model A Conversion Rate: {conversion_rate_a:.3f}") print(f"Model B Conversion Rate: {conversion_rate_b:.3f}")
Attempts:
2 left
💡 Hint
Conversion rate is conversions divided by visitors.
✗ Incorrect
Model A: 120/1000 = 0.12; Model B: 150/1200 = 0.125; formatted to 3 decimals matches option A.
❓ Hyperparameter
advanced2:00remaining
Choosing Sample Size for A/B Testing
Which factor is most important when deciding the sample size for an A/B test comparing two machine learning models?
Attempts:
2 left
💡 Hint
Think about what affects the ability to detect a difference in results.
✗ Incorrect
Sample size depends mainly on the expected effect size (difference in performance) to ensure statistical significance.
❓ Metrics
advanced2:00remaining
Interpreting A/B Test Results with Confidence Intervals
If the 95% confidence interval for the difference in conversion rates between Model B and Model A is [-0.01, 0.03], what can you conclude?
Attempts:
2 left
💡 Hint
Check if zero is inside the confidence interval.
✗ Incorrect
Since zero is within the interval, the difference could be zero, so no significant difference is detected.
🔧 Debug
expert3:00remaining
Identifying the Bug in A/B Test Data Split Code
What error will this Python code raise when splitting data for an A/B test, and why?
code:
import numpy as np
users = np.array([1,2,3,4,5,6,7,8,9,10])
np.random.seed(42)
mask = np.random.rand(len(users)) > 0.5
ab_test_group = users[mask]
control_group = users[~mask]
print(f"A/B Test Group: {ab_test_group}")
print(f"Control Group: {control_group}")
print(f"Total users: {len(ab_test_group) + len(control_group)}")
Attempts:
2 left
💡 Hint
Check the type and length of the mask array.
✗ Incorrect
np.random.rand(len(users)) > 0.5 creates a boolean mask of the same length as users, so indexing works fine and no error occurs.