You may have read my previous post about customer churn prediction. Another similar problem that’s just as important as predicting lost customers, is predicting customers’ daily expenditure.
Let me give you an example: you work for a large retailer which has a loyalty card scheme. You’d like to predict for a given customer how much they are likely to spend over the next week.
In this case normally there would be clear patterns
However there are a few problems when you get down to customer level:
What this means is that, if you look at all customers’ expenditures (or averaged over a region), you will probably see some recognisable weekly, monthly and seasonal patterns:
However for a single customer it’s hard to make out any recognisable pattern among all the noise. The weekly and yearly trends were only apparent when we averaged over all customers.
Fast Data Science - London
So how can you go about predicting the future expenditure of a given customer the next time they enter the shop?
This problem is quite interesting as there are at least two very different approaches to solving it, from two different traditional disciplines:
This means that depending on whether you hire somebody with a machine learning background, or somebody with a statistics background, you may get two contradictory answers.
In this post I’ll talk only about the predictive modelling approach.
If you are interested in predicting the first graph, which is averages for groups of customers, you might want to look into my next post on time series analysis.
The simplest way would be to use a predictive modelling machine learning approach. For example you could use Linear Regression. If you are unfamiliar with how to do this I recommend Andrew Ng’s Coursera course.
You would provide as input to your Regression model:
The output you want it to predict is:
This will predict the next purchase with some accuracy. After all the biggest factor to predict what someone will buy, is what they bought in the past.
However I’m sure you can easily think of some cases where this will break down. For example
You can improve the performance of the Predictive Model approach by making it a little more sophisticated:
If you have a prediction problem in retail, or would like to some help with another problem in data science, please contact me.
In practice it can be tricky to get the data on each customer that I described above. You need to extract certain statistics on customers’ past purchases from your database to train your model, and also query your database in real time to run a prediction. If you would like more ideas on how to do this please check out my video on the topic or this Python tutorial on Github, or read more about AI in business on our blog.
Dive into the world of Natural Language Processing! Explore cutting-edge NLP roles that match your skills and passions.
Explore NLP JobsThis free A/B test calculator will help you compare two variants of your website, A and B, and tell you the probability that B is better. You can read more about A/B testing in our earlier blog post on the subject. You may also be interested in our Chi-Squared sample size calculator which will help you calculate the minimum sample size needed to run a Chi-Squared test, given an expected standardised effect size.
See also: Fast Data Science A/B test Calculator (Bayesian) A/B testing is a way you can test two things, Thing A, and Thing B, to see which is better. You most commonly hear about A/B testing in the context of commercial websites, but A/B testing can be done in a number of different contexts, including offline marketing, and testing prices.
Explainable AI for Businesses Guest post by Vidhya Sudani Introduction AI is moving rapidly and it can be hard to understand how an AI model works and what decisions it makes. Businesses are increasingly turning to Explainable AI (XAI) to demystify the “black box” nature of traditional machine learning models.
What we can do for you