Product Segmentation for Retail with Python
A statistical methodology to segment your products based on turnover and demand variability
A statistical methodology to segment your products based on turnover and demand variability
Article originally published on Medium.
Product segmentation refers to the activity of grouping products that have similar characteristics and serve a similar market. It is usually related to marketing (Sales Categories) or manufacturing (Production Processes).
However, as a Logistics Manager, you rarely care about the product itself when managing goods flows; except for the dangerous and oversized products.
Your attention is mainly focused on the sales volumes distribution (fast/slow movers), demand variability and delivery lead time.
You want to put efforts into managing products that have:
- The highest contribution to your total turnover: ABC Analysis
- The most unstable demand: Demand Variability
In this article, we will introduce simple statistical tools to combine ABC Analysis and Demand Variability to perform products segmentation.
💌 New articles straight in your inbox for free: Newsletter
I. Scenario
1. Problem Statement
2. Scope Analysis
3. Objective
II. Segmentation
ABC Analysis
Demand Stability: Coefficient of Variation
Normality Test
III. Conclusion
I. Scenario
1. Problem Statement
You are the Operational Director of a local Distribution Center (DC) that delivers 10 Hypermarkets.
In your scope you the responsibility of
- Preparation and delivery of replenishment orders from stores
- Demand Planning and Inventory Management
2. Scope Analysis
This analysis will be based on the M5 Forecasting dataset of Walmart stores' sales records (Link).
We suppose that we only have the first-year data (d_1 to d_365):
- 10 stores in 3 states (USA)
- 1,878 unique SKU
- 3 categories and 7 departments (sub-category)
Except for the warehouse layout, categories and departments have no impact on your ordering, picking or shipping processes.
Code — Data Processing
3. Objective
What does impact your logistic performance?
Products Rotation
What are the references that are driving most of your sales?
- Very Fast Movers: top 5% (Class A)
- The following 15% of fast movers (Class B)
- The remaining 80% of very slow movers (Class C)
This classification will impact,
- Warehouse Layout
Reduce Warehouse Space with the Pareto Principle using Python
- Picking Process
Improve Warehouse Productivity using Order Batching with Python
Demand Variability
How stable is your customers’ demand?
- Average Sales: µ
- Standard Deviation:
- Coefficient of Variation: CV = σ/µ
For SKUs with a high value of CV, you may face unstable customer demand that would lead to workload peaks, forecasting complexity and stock-outs.
Code
- Filter on the first year of sales for HOBBIES Skus
- Calculate the Mean, Standard deviation and CV of sales
- Sorting (Descending) and Cumulative sales calculation for ABC analysis
II. Product Segmentation
This analysis will be done for the SKU in the HOBBIES category.
1. ABC Analysis
What are the references that are driving most of your sales?
In this example, we cannot clearly observe the Pareto Law (20% of SKU making 80% of the turnover).
However, we still have 80% of our portfolio making less than 50% of the sales.
Code
2. Demand Stability: Coefficient of Variation
How stable is your customers’ demand?
From the Logistics Manager's point of view, it is way more challenging to handle a peak of sales than a uniform distribution throughout the year.
In order to understand which products will bring planning and distribution challenges, we will compute the coefficient of variation of the yearly distribution of sales of each reference.
Code
3. Normality Test
Can we assume that the sales follow a normal distribution?
Most of the simple inventory management methods are based on the assumption that the demand follows a normal distribution.
Why?
Because it’s easy.
Sanity Check
Before starting to implement rules and perform forecasts it’s better to verify that this hypothesis cannot be refuted.
We’ll be using the Shapiro-Wilk test for normality; it can be implemented using the Scipy library. The null hypothesis will be (H0: the demand sales follow a normal distribution).
Bad News
For an alpha = 0.05, we can reject the null hypothesis for most of the SKUs. This will impact the complexity of inventory management assumptions.
Code
III. Conclusion
This operationally driven segmentation gives us a few insights into the challenges your operations will face for planning and managing the goods flows to meet your store's demand.
About Me
Let’s connect on Linkedin and Twitter, I am a Supply Chain Engineer that is using data analytics to improve logistics operations and reduce costs.
If you’re looking for tailored consulting solutions to optimize your supply chain and meet sustainability goals, feel free to contact me.
References
[1] Reduce Warehouse Space with the Pareto Principle using Python
[2] Improve Warehouse Productivity using Order Batching with Python
[3] Scipy stats Shapiro Test documentation, Link