ROMI after RFM
After the campaign, you can calculate the ROMI, or return on marketing investment. First, we are going to extract the users we want from the RFM cell. Given we know our breakeven conversion rate – 15.625% – we will group the data in rfm_result
using the purchase
column, and add a new column, named target
, to indicate whether we have sent a catalog or not to that cell.
We will do this both for the independent and sequential targeting groups and merge them:
selection_seq_df = \ rfm_result.groupby(['rfm_score_seq'])['purchase'].mean().reset_index() selection_seq_df['target_seq'] = \ np.where(selection_seq_df.purchase > 0.15625, 1, 0) selection_ind_df = \ rfm_result.groupby(['rfm_score_indep'])['purchase'].mean().reset_index() selection_ind_df['target_ind'] = \ np.where(selection_ind_df.purchase...