Predicting Customer Activity Absence

Could you please assist me with to following question?

I have a customer activity dataframe that looks like this:

It contains at least 500.000 customers and a "timeseries" of 42 months. The ones and zeroes represent customer activity. If a customer was active during a particular month then there will be a 1, if not - 0. I need determine those customers that most likely (+ probability) will not be active during the next 6 months (2018 July-December).

Could you please direct me what approach/models should i use in order to predict this? I use Python.

Thanks in advance!

Topic data-analysis dataframe prediction pandas python

Category Data Science


Before we could begin to predict, we need a bit more information on the kind of customer activity you're talking about. Domain information is key in any ML task. That would also help us identify if there is any autocorrelation between the previous months activity and the next months. If there is no autocorrelation then the time series becomes stochastic and there is no predictive analysis that can be done here without introducing any other features. If there is correlation and seasonality, maybe we could look into training a SARIMA model on your data.


First issue in your model building method is that you have data in the binary form for each month and you are trying to predict into a 6 month time period. You gotta define what will be considered active in the next 6 months?

  1. Active in 6 months = Active in each individual months? or
  2. Active in 6 months = Active in any given month?

If you want to first predict for individual months, you can use logistic regression. It is useful for a binary classification of this kind.

Use LogisticRegression from sklearn.linear_model to train and fit the data. Then, use confusion matrix and classification_report from sklearn.metrics to test the performance of your model.

After having predictions for next 6 months, you can create a new column that checks if there are any 1's in the last 6 months and stores 1 else stores 0

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.