1
$\begingroup$

Could you please assist me with the following question?

I have a customer activity data frame that looks like this: enter image description here

It contains at least 500.000 customers and a "time series" 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 to determine those customers that most likely (+ probability) will not be active during the next six months (2018 July-December).

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

Thanks in advance!

$\endgroup$
4
  • $\begingroup$ This question is way too broad. What have you tried already? Have you done any basic statistical analysis? Are the data any different from random 1s and 0s? Have you seen any patterns? Is your outcome "any activity (ie at least one "1") in the next six months"? $\endgroup$
    – Spacedman
    Commented Jun 16, 2018 at 9:44
  • $\begingroup$ @Spacedman: Thanks for your input. To be honest i'm a bit lost (+ very new to this field) and haven't done anything yet. No, the data is only 1 and 0. The outcome would be, as you mentioned, "any activity". If there is at least one 1 in the next 6 months then I am not interested in this customer. $\endgroup$
    – Andrei
    Commented Jun 16, 2018 at 9:58
  • $\begingroup$ Is there seasonality (a yearly pattern)? Is there serial correlation in the 1s (ie you are more likely to get 10 1s in a row than if they are completely random)? Do 1s "tail off" for all customers? Do some basic descriptive summaries before thinking all you need to do is throw it into a magic machine learning algorithm. $\endgroup$
    – Spacedman
    Commented Jun 16, 2018 at 15:40
  • $\begingroup$ There pretty much might be a seasonality pattern, that's what i'm trying to figure out. Some of them might have had 1's for a few years and afterwards are just trailing 0's that pretty much mean (based on the data available) that the customer will not be active anymore. Some of them have only a few 1's in the middle of the selected daterange (these are, as well, not very likely to produce new activity). Some might bring up recurring activity based on seasonality (these are the one's id like to determine). There might not have been any sight from them recently but the might be active again soon $\endgroup$
    – Andrei
    Commented Jun 16, 2018 at 15:47

2 Answers 2

0
$\begingroup$

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

$\endgroup$
3
  • $\begingroup$ A logistic regression model has no other covariates for this data, so it can only predict a mean for each customer, so you may as well count the fraction of 1s for each customer and use that as a percentage probability of a 1 in any month. Then combinatorics and probability theory gets you the P(>0 1s in the next six months). Basic probability theory, no need to "learn" anything. The next level would be to assume some kind of time trend, but that requires a model as a function of time, and an assumed correlation structure and so on. $\endgroup$
    – Spacedman
    Commented Jun 16, 2018 at 14:57
  • $\begingroup$ Individual months actually do not matter. I'm interested in the 6-month period a s whole. I think seasonality plays a big role here. $\endgroup$
    – Andrei
    Commented Jun 16, 2018 at 15:51
  • $\begingroup$ @Spacedman You are right. Should delete this answer? $\endgroup$ Commented Jun 17, 2018 at 14:12
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.