Data Science, Product Analytics, Ab Testing, Simulation, Deep Dives.
effect_size): base_ret_model = smf.logit('retention ~ num_family_members', data = pop_df).fit(disp = 0) tmp_pop_df = pop_df.copy() tmp_pop_df['predicted_retention_proba'] = base_ret_model.predict() sample_df = tmp_pop_df.sample(sample_size) sample_df['treatment'] = sample_df.index.map(lambda x: 1