I have a time series of data in the following form:
| purchase_date | cutomer_id | num_purchases | churned |
2018-10-31 id1 39 0
2018-11-31 id1 0 0
2019-01-31 id1 6 1
2019-03-31 id2 300 0
2018-04-31 id2 2 1
I grouped the data by month and summed num_purchases by month. The churned column for user id1 for example represents in which month customer churned. So
id1 in my case churned in January. Before this, to label who has churned or not, we sampled customers based on 2 months of inactivity period from the churn date. I need to predict if a user is going to churn in a 2 months from now. I am not sure what is the best approach for this.
- Q1: Should I be grouping customers like I am doing, on a monthly basis or I have to group them on a 2-month basis since that is how they were labeled?
- Q2: Also, how do I model this? Do I keep
customer_idas a feature of the model or not? Is the gap in dates for each customer relevant and how should I deal with it (if)? The dates repeat for different users, should I create index out of a date but it won't be unique or should I create index out of customer_id?
- Q3: If I need to predict whether the user is going to churn by the end of the year for example or in the next 6 months, would that change how I group/arrange my date and model this?
I plan to add more features to this dataframe (both categorical and numerical).