Data Science, Product Analytics, Ab Testing, Simulation, Deep Dives.
if np.random.uniform() > 0.5 else 0) sample_df['predicted_retention_proba'] = sample_df['predicted_retention_proba'] + effect_size * sample_df.treatment sample_df['retention'] = sample_df.predicted_retention_proba.map(lambda x: 1 if x >= np.random.uniform() else 0) return sample_df def