Back to portfolio MSc project
MSc · Machine Learning & AI

Customer segmentation & forecasting

RFM segmentation with K-Means, plus ARIMA and Prophet forecasting on an online-retail dataset: segmenting who the customers are, and testing two ways to forecast what they'll buy next.

RFM
+ K-Means
ARIMA
forecasting
Prophet
forecasting
Python
stack
Scope My Machine Learning and AI project, worked individually in Python. Cluster profiles and forecast charts are in the submitted notebook.

The problem

Two questions an online retailer always has: who are my customers, and what is demand going to do next? The first drives who you target and how you talk to them; the second drives what you stock and when. Different questions, so they need different methods.

Approach

Engineered RFM features (recency, frequency, monetary) and clustered customers with K-Means into five segments, choosing the number of clusters from the elbow plot rather than by eye. Then forecast demand two ways, classical ARIMA and Prophet, deliberately setting a statistical model against an additive one on the same series to see which held up. All in Python.

Result

Five interpretable segments a marketing team can act on, with high-value regulars separated from lapsing and one-off buyers, and two demand forecasts set side by side. I'd be straight about the forecasts in an interview: on this noisy retail series they came out directional rather than precise, and neither ARIMA nor Prophet clearly beat the other. The useful conclusion is the one a business actually needs, though: the segmentation is solid enough to target on, while the forecasting result says the method matters and this particular data would need more signal before you'd plan stock against it.

Tools

Python scikit-learn ARIMA Prophet

RFM clusters plotted as monetary value against recency, coloured by K-Means cluster into five customer segments
RFM segments: K-Means clusters customers by recency, frequency and monetary value.
Auto ARIMA sales forecast for the next 60 days with a confidence band
Forecast one way: Auto ARIMA, 60-day sales projection with a confidence band.
Prophet sales forecast for the next 60 days with uncertainty intervals
And the other: Prophet, same horizon, for a side-by-side comparison.