A complete customer segmentation solution using RFM Analysis and K-Means clustering to identify 5 actionable customer segments and generate ₹1.36 Crore revenue opportunity through targeted marketing strategies.
Company: ShopEase Online Retail
Challenge: Treating all 4,970 customers the same, wasting 60% of marketing budget
Current State: No personalization, high acquisition costs (₹5,000/customer), unknown customer value
Goal: Segment customers and create targeted strategies to maximize ROI
Built a data-driven customer segmentation system that:
- Segments 4,970 customers into 5 actionable groups using RFM + K-Means
- Calculates Customer Lifetime Value (CLV) for prioritization
- Identifies ₹1.36 Crore revenue opportunity (3.59:1 ROI)
- Provides specific marketing strategies for each segment
| Segment | Customers | Avg CLV | Total Revenue | Characteristics |
|---|---|---|---|---|
| Champions | 877 (17.6%) | ₹1,326 | ₹11.63L | Recent, frequent, high spenders - VIP treatment |
| Loyal Customers | 1,301 (26.2%) | ₹796 | ₹10.36L | Consistent buyers - cross-sell opportunities |
| Big Spenders | 541 (10.9%) | ₹744 | ₹4.03L | High value but infrequent - increase frequency |
| Need Attention | 818 (16.5%) | ₹432 | ₹3.53L | At risk of churning - win-back campaigns |
| Lost/Hibernating | 1,433 (28.8%) | ₹274 | ₹3.92L | Inactive customers - reactivation needed |
- Top 2 segments generate 58% of revenue (Champions + Loyal)
- 1,433 customers are inactive = ₹3.92L at stake
- Average CLV: ₹673 across all customers
- Total CLV potential: ₹33.5 Lakhs if retention improves
| Segment | Investment | Expected Return | Net Gain | ROI |
|---|---|---|---|---|
| Champions | ₹17.54L | ₹87.70L | ₹70.16L | 5:1 |
| Loyal Customers | ₹13.01L | ₹52.04L | ₹39.03L | 4:1 |
| Big Spenders | ₹8.12L | ₹24.34L | ₹16.23L | 3:1 |
| Need Attention | ₹6.54L | ₹13.09L | ₹6.54L | 2:1 |
| Lost/Hibernating | ₹7.17L | ₹10.75L | ₹3.58L | 1.5:1 |
| TOTAL | ₹52.37L | ₹187.92L | ₹135.55L | 3.59:1 |
Bottom Line: Invest ₹52 Lakhs → Generate ₹1.36 Crore net gain
-
RFM Analysis
- Recency: Days since last purchase
- Frequency: Number of purchases
- Monetary: Total amount spent
- Scored each metric 1-5 (5 = best)
-
K-Means Clustering
- Used Elbow Method to find optimal K=5
- Standardized features for equal weighting
- Created distinct, actionable segments
-
Customer Lifetime Value (CLV)
- Formula: Avg Order Value × Purchase Frequency × Lifespan
- Estimated lifespan based on recency patterns
- Calculated total CLV: ₹33.5 Lakhs
-
Marketing Strategy Development
- Segment-specific action plans
- ROI projections per strategy
- Implementation timeline
customer-segmentation-analysis/
├── data/
│ ├── raw/ # Transaction data (25,000 records)
│ └── processed/ # RFM scores, segments, CLV
├── notebooks/
│ └── 01_rfm_analysis_and_segmentation.ipynb
├── sql/
│ └── customer_segmentation_queries.sql
├── reports/
│ ├── elbow_method.png
│ └── customer_segments_visualization.png
└── README.md
Goal: Retain and maximize value
Actions:
- VIP Program with exclusive access
- Loyalty rewards with premium benefits
- Referral incentives (₹500/referral)
- Early sale access
- Dedicated account manager
Investment: ₹2,000/customer/year | ROI: 5:1
Goal: Increase frequency and value
Actions:
- Cross-sell campaigns
- Volume discounts (10% off >₹1000)
- Birthday rewards
- Loyalty points program
- Quarterly exclusive offers
Investment: ₹1,000/customer/year | ROI: 4:1
Goal: Increase purchase frequency
Actions:
- Buy 2 get 1 free promotions
- Subscription model (15% discount)
- Product bundles
- Replenishment reminders
- Free shipping + gift wrapping
Investment: ₹1,500/customer/year | ROI: 3:1
Goal: Prevent churn
Actions:
- 20% win-back discount
- Feedback surveys
- Personalized recommendations
- 48-hour urgency deals
- Free shipping
Investment: ₹800/customer/year | ROI: 2:1
Goal: Reactivate dormant customers
Actions:
- 30% comeback offer
- "What's new" campaigns
- Personal phone calls (high-value)
- Zero barriers (₹0 minimum, free returns)
- Category-specific offers
Investment: ₹500/customer/year | ROI: 1.5:1
- Python 3.11: Data processing and ML
- Pandas & NumPy: Data manipulation
- Scikit-learn: K-Means clustering, StandardScaler
- Matplotlib & Seaborn: Visualizations
- Jupyter Notebook: Analysis documentation
- SQL: Customer segment extraction
- RFM Analysis: 4,970 customers scored and ranked
- Customer Segments: 5 distinct, actionable groups
- CLV Calculations: Lifetime value for each customer
- Marketing Strategies: Detailed plans with ROI per segment
- SQL Queries: 12 production-ready queries
- Visualizations: Elbow method, 3D segment view, revenue analysis
- Month 1-2: Launch Champions & Loyal programs (highest ROI)
- Month 3-4: Implement Big Spenders frequency campaigns
- Month 5-6: Deploy Need Attention retention efforts
- Month 7-12: Ongoing Lost customer reactivation
- Segment migration (customers moving up/down)
- Purchase frequency increase per segment
- Average order value growth
- Customer retention rate (especially Champions)
- Reactivation rate for Lost segment
- Campaign ROI vs projections
git clone https://github.com/priyanka7411/customer-segmentation-analysis.git
cd customer-segmentation-analysis
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtjupyter notebook
# Open notebooks/01_rfm_analysis_and_segmentation.ipynbLoad sql/customer_segmentation_queries.sql into your database
Current State:
- 4,970 customers
- ₹27.56 Lakhs total revenue
- No segmentation or targeting
- Wasting marketing budget
After Implementation:
- 5 clear customer segments
- ₹1.36 Crore additional revenue potential
- 3.59:1 marketing ROI
- Personalized strategies per segment
- Data-driven decision making
Priyanka Malavade
BCA Graduate | GUVI Certified Data Scientist (2025)
- Email: [email protected]
- LinkedIn: linkedin.com/in/priyanka-malavade-b34677298
- GitHub: github.com/priyanka7411
- E-Commerce Sales Analysis - Revenue analysis, $1.5M opportunity
- HR Attrition Prediction - ML model, ₹1.35 Cr savings
- Customer Segmentation (This Project) - ₹1.36 Cr revenue opportunity
This project is for educational and portfolio purposes.
Note: All financial figures in Indian Rupees (₹). Lakhs (L) = 100,000 | Crore (Cr) = 10,000,000