Demand Segmentation with ML models
Ravi Prakash
Senior Manager , Planning and Business Systems , Johnson and Johnson , APAC , MedTech
For supply chain professionals demand segmentation is a very familiar word . If you have worked in any organization as demand planner then you might have either implemented ABC-XYZ analysis or adopted some variant of this standard statistical approach of segmentation. At the core it lies our need to improve demand planning accuracy ( say metrics ) by focusing limited resources where it matters most . Let us say that you have thousands of SKUs in your portfolio and have been tasked by your manager to find a better strategy to do demand planning . One approach ( Like 6 Months moving average *) may not be best way to model your data . May be there exists some SKUs which are better left to stat models releasing lots of time for planning team to focus on other activities . ABC-XYZ analysis and it’s variants guide you towards that direction . In this article, objective is to explore the idea of doing demand segmentation using ML models ( Not deep learning !) . Is it really possible ? Yes, ping ChatGPT , it throws up plethora of details about the same but we intend to go beyond that . In business set up , we search for what works !
DATA
I have created an imaginary data base that loosely represents the demand pattern we see in real world . There are 47 SKUs with demand history of 24 months ( in monthly buckets, data shape =(47,25)).
Each of these SKUs are representing a different demand group . It is important that we familiarizes ourselves before we proceed any further .
LTS — Stands for demand history with Level, Trend and seasonality , LS — Level and Seasonality , INT — intermittent demand , V — very volatile ( Once in a while meagre demand ), INT and V are difficult to forecast . We have 9 SKUs which fall into LTS category.
In below chart , you can actually observe the demand pattern ( I have applied group by on Type , consolidated with mean value) and convince yourself that it is the case . For example , LFS ( green line ) shows the seasonality and trend .
Modeling ( Unsupervised )
We will work with Gaussian Mixture model ( GMM) . If you are not familiar with GMM then you can either google it or use ChatGPT . Any way I would not leave you in complete darkness either . Very loosely speaking , it can be called soft K-Means . Also note that probability and likelihood are two different things. Most of ML algorithms use MLE ( Maximum Likelihood estimate ) and so is the case with GMM. Given the observation ( in our case demand data ) , we try to estimate the parameters ( mean , weights and Variance ) which optimizes the log likelihood ! Since there is no straight solution to optimization , expectation and maximization approach is used . There is quite a bit of math involved so I would suggest that you refer to some articles on web .
领英推荐
What you see above is the outcome . 0,1,2,3 etc are clusters as learned by GMM. Surprisingly such a powerful ML algorithm has disappointed us here . LTS Skus are clustered with three groups ( 0,2,3) against expectation of one . Don’t know why it happened . I tried multiple iterations ( without scaling as well) but outcomes were more or less similar . May be dataset is very small .?We can easily get the clusters statistically by just looking at ration of ( Mean /Standard deviation )?. Feel free to share your experience if any .
Modeling Supervised
I know that I have a very small date set but still experimented with Random Forest Classifier .
From above scatter chart , we can clearly see that story is not different here either . Cluster 2 is predicted as 2 but also as 1 and it the same case with 3 etc. Given the size of training data set , RFC can be excused but the fact is there are many industry where we don’t have more data . A beer manufacturing company will not have more than 50 SKUs ( our dataset actually imitates demand pattern of this industry ( India ) ) then these shallow ML models may not be useful .
Let us conclude here . We need more experimentation to judge the effectiveness of ML models ( shallow , not deep learning ) on demand segmentation . It is also obvious that industries with lesser number of SKUs would be better served by adopting statistical approach of demand segmentation . ML algorithms are very capable enough but they simply do not seem to learn the trick for segmentation !