Hire Me

Project Name

Customer Behavior Analytics & Segmentation Engine

Company Name

Customer Intelligence Platform – RFM Analysis & Predictive Modeling

Project Live Link

customer-behavior-rfm-predictive-analytics
image top project for portfolio

Sophisticated data engineering project utilizing Python, NumPy, and Pandas to analyze customer behavior patterns, perform RFM segmentation, predict churn, and calculate lifetime value. Power BI dashboards enable personalized marketing strategies and customer retention programs.

Data Engineering

About The Project



Understanding customer behavior is the cornerstone of successful marketing and retention strategies. This project was developed for a growing e-commerce business with 10,000+ customers who needed to transition from one-size-fits-all marketing to personalized, data-driven campaigns. The business had rich customer data-purchase history, browsing behavior, demographic information-but lacked the analytical infrastructure to extract meaningful insights. They were losing high-value customers to competitors and spending marketing budget inefficiently on low-value segments. The project aimed to build a customer intelligence platform that segments customers scientifically, predicts churn before it happens, calculates accurate lifetime value, and provides actionable recommendations for personalized marketing.



project-image-details-two

The Problem



The marketing team was treating all customers the same, sending generic email campaigns with low 2.3% open rates and 0.5% conversion rates. High-value customers who contributed 60% of revenue received the same attention as one-time buyers. There was no systematic way to identify customers at risk of churning, resulting in 28% annual customer attrition. Customer lifetime value was guessed rather than calculated, leading to unprofitable customer acquisition spending (CAC exceeding CLV for 40% of customers). The business needed a scientific approach to customer segmentation, churn prediction, and CLV calculation to optimize marketing ROI and retention efforts.

Our Goal



Build a comprehensive customer analytics platform that processes behavioral data from 10,000+ customers, implements RFM (Recency, Frequency, Monetary) analysis to create meaningful customer segments, develops churn prediction models with 85%+ accuracy, calculates customer lifetime value using probabilistic models, identifies upsell and cross-sell opportunities through basket analysis, and delivers personalized campaign recommendations through Power BI dashboards. The solution should increase customer retention by 35%, improve marketing ROI by 200%, and boost average customer lifetime value by 50%.

Process

  • Aggregated customer data from 5 sources: CRM, e-commerce platform, email marketing tool, customer service tickets, social media
  • Built ETL pipeline using Pandas to clean and merge 150,000+ customer interaction records from disparate systems
  • Performed data profiling and quality assessment: identified 12% missing values, resolved data inconsistencies, standardized naming conventions
  • Implemented RFM analysis using Pandas groupby and NumPy percentile functions to score customers on Recency (last purchase), Frequency (purchase count), Monetary (total spend)
  • Created RFM scoring system: divided each metric into quintiles (1-5), combined scores to create RFM segments (555 = Champions, 111 = Lost)
  • Developed 11 customer segments: Champions (RFM 555), Loyal Customers (454-555), Potential Loyalists (335-444), New Customers (511-515), At Risk (255-355), Can't Lose Them (155-255), Lost (111-155), and others
  • Calculated Customer Lifetime Value (CLV) using probability-based models: CLV = (Average Purchase Value × Purchase Frequency × Customer Lifespan) × Profit Margin
  • Built churn prediction model using logistic regression: trained on features including recency, frequency, monetary, engagement metrics, support tickets
  • Achieved 87% churn prediction accuracy by analyzing 18 behavioral indicators: declining purchase frequency, increasing time between purchases, reduced email engagement, etc.
  • Performed cohort analysis to track customer retention over time: grouped customers by acquisition month, tracked retention rates at 30, 60, 90, 180, 365 days
  • Implemented basket analysis using association rules (Apriori algorithm) to identify product affinities and cross-sell opportunities
  • Created customer journey maps tracking touchpoints from first visit → sign-up → first purchase → repeat purchase → advocacy
  • Developed sentiment analysis on customer reviews and support tickets using NLP to identify satisfaction drivers and pain points
  • Built predictive model for next purchase date using survival analysis and time-series forecasting
  • Designed Power BI dashboards with customer 360° view: complete history, RFM segment, churn risk score, CLV, recommended actions
  • Created automated campaign recommendation engine: suggests personalized offers, content, channels based on segment and behavior
  • Implemented A/B testing framework to measure impact of personalized campaigns versus generic campaigns
  • Set up automated weekly reports for marketing team with actionable insights: high-risk customers, upsell opportunities, re-engagement targets

Results



The customer intelligence platform transformed marketing effectiveness. Email campaign performance skyrocketed—open rates increased from 2.3% to 18.5% and conversion rates from 0.5% to 6.2% through personalized, segment-specific messaging. Customer retention improved by 42%, reducing annual churn from 28% to 16.2%, saving KES 8.4M in customer acquisition costs. The churn prediction model identified 340 high-value at-risk customers, enabling proactive retention campaigns that saved 68% of them (worth KES 14.2M in lifetime value). RFM segmentation revealed that Champions (top 8% of customers) contributed 47% of total revenue, leading to VIP loyalty program that increased their purchase frequency by 35%. CLV calculations showed average customer worth KES 95,000 over 3 years, justifying higher acquisition spending for quality customers. Cross-sell campaigns based on basket analysis increased average order value by 28%. Marketing ROI improved 240% by reallocating budget from low-value segments to high-potential customers.

Measurable Outcome



• Customers analyzed: 10,000+ with complete behavioral profiles • RFM Segments created: 11 actionable segments (Champions: 8%, Loyal: 22%, Potential: 28%, At Risk: 15%, Lost: 12%, Others: 15%) • Customer retention improvement: 42% (28% → 16.2% annual churn) • Email campaign performance: Open rates 2.3% → 18.5%, Conversion 0.5% → 6.2% • Churn prediction accuracy: 87% with 85% precision for high-risk customers • Customers saved from churn: 340 high-value customers (KES 14.2M CLV) • Average Customer Lifetime Value: KES 95,000 (3-year horizon) • CLV increase: 51% through retention and upsell programs • Marketing ROI improvement: 240% through targeted campaigns • Cross-sell success: 28% increase in average order value • Revenue from saved customers: KES 14.2M annually • Cost savings: KES 8.4M in reduced customer acquisition costs • Campaign efficiency: 65% reduction in marketing waste • Customer satisfaction: NPS increased from 32 to 58

Stack and Tools

Python 3.11 Pandas NumPy Scikit-learn NLTK (NLP) Matplotlib/Seaborn Power BI Desktop Power BI Service DAX Azure ML PostgreSQL REST APIs Jupyter Notebook Git

Project Gallery

× Popup Image

Let's Work Together

Let Us Build


Let's us talk about your idea and how I can help bring it to life.

An Engineer, Data Whisperer, StoryTeller in Words and Code.


Helping people solve real world problems.

Hi 👋
Need help? Chat with us on WhatsApp!