Last active
October 3, 2019 19:20
-
-
Save lylayang/5eb73934a2461b159d376ceac26f9b9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
# score in test are 10% greater than ctrl (per record) | |
# ctrl has 5x the number of records as test and10% lift in test | |
lift = 1.1 | |
test = np.random.binomial(100, p=0.2 * lift, size=10000) * 1.0 | |
ctrl = np.random.binomial(100, p=0.2, size=50000) * 1.0 | |
bins = np.linspace(0, 40, 20) | |
plt.hist(ctrl, bins=bins, label='Control') | |
plt.hist(test, bins=bins, label='Test', color='orange') | |
plt.title('Test/Ctrl Data') | |
plt.legend() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment