Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to split data into two groups for A/B testing.
TensorFlow
group_a = data[:[1]] group_b = data[[1]:]
Attempts:
3 left
💡 Hint
Common Mistakes
Using 50 without considering data length.
Using 0 which results in empty group_a.
✗ Incorrect
We split the data into two equal parts using half the length of the data.
2fill in blank
mediumComplete the code to calculate the conversion rate for group A.
TensorFlow
conversion_rate_a = sum(group_a['converted']) / [1]
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing by length of group B or total data.
Dividing by sum of conversions which is incorrect.
✗ Incorrect
Conversion rate is the number of conversions divided by the total number in group A.
3fill in blank
hardFix the error in the code to perform a t-test between groups A and B.
TensorFlow
from scipy.stats import ttest_ind stat, p_value = ttest_ind(group_a['converted'], [1])
Attempts:
3 left
💡 Hint
Common Mistakes
Using group A twice instead of group B.
Using unrelated columns like 'not_converted'.
✗ Incorrect
The t-test compares the 'converted' values of group A and group B.
4fill in blank
hardFill both blanks to calculate the uplift and check if it is positive.
TensorFlow
uplift = conversion_rate_b - [1] is_positive = uplift [2] 0
Attempts:
3 left
💡 Hint
Common Mistakes
Subtracting group B from group A instead.
Using less than sign instead of greater than.
✗ Incorrect
Uplift is the difference between group B and group A conversion rates. We check if uplift is greater than zero.
5fill in blank
hardFill all three blanks to create a summary dictionary of A/B test results.
TensorFlow
summary = {
'group': [1],
'conversion_rate': [2],
'p_value_significant': [3]
}Attempts:
3 left
💡 Hint
Common Mistakes
Mixing group labels and conversion rates.
Using p_value without comparison.
✗ Incorrect
The summary shows group B's conversion rate and whether the p-value indicates significance.
