Skip to content

Analyzing customer behavior and churn risk with RFM Segmentation. A data-driven approach to optimize marketing strategies using Python & Power BI.

Notifications You must be signed in to change notification settings

Farslan-x/CRM-Analytics-RFM-Segmentation

Repository files navigation

📊 E-Commerce Customer Segmentation & RFM Analytics

Python Power BI Pandas

💼 Business Problem

An e-commerce company wants to segment its customers and determine marketing strategies according to these segments. The company aims to increase revenue by organizing specific campaigns for loyal customers and retention strategies for those at risk of churning.

Objective: To perform RFM (Recency, Frequency, Monetary) analysis using Python and visualize the customer landscape using Power BI to derive actionable business insights.


📈 Dashboard Preview

Dashboard Preview


⚙️ Methodology

1. Data Preparation (Python)

  • Dataset: Online Retail II (UCI Machine Learning Repository).
  • Data Cleaning:
    • Removed cancelled transactions (Invoice numbers starting with 'C').
    • Handled missing values in Customer ID.
    • Filtered out outliers and negative quantities.
  • Feature Engineering: Calculated TotalPrice (Quantity * Price) to determine Monetary value.

2. RFM Analysis

Customers were scored (1-5) based on three key metrics:

  • Recency (R): Days since the last purchase. (Lower is better)
  • Frequency (F): Total number of transactions. (Higher is better)
  • Monetary (M): Total revenue generated. (Higher is better)

3. Customer Segmentation

Using Regex, customers were grouped into segments such as:

  • Champions: Bought recently, buy often, and spend the most.
  • Hibernating: Last purchase was long ago, low spenders and low number of orders.
  • Can't Loose: Used to buy frequently but haven't returned for a long time.

💡 Key Business Insights

Based on the analysis results:

  1. Pareto Principle in Action:

    • The "Champions" and "Loyal Customers" segments make up a small percentage of the total customer base but generate the majority of the total revenue.
    • Action: VIP customer support and exclusive loyalty programs should be prioritized for this group.
  2. Churn Risk Alert:

    • A significant cluster of customers falls into the "Hibernating" and "At Risk" segments.
    • Action: Aggressive re-marketing campaigns (e.g., "We missed you" discount coupons) are required to reactivate these high-potential churners.
  3. Cross-Sell Opportunity:

    • "New Customers" show a high Average Order Value (AOV).
    • Action: Personalized product recommendations should be offered immediately after their first purchase to increase retention.

🚀 How to Run the Project

  1. Clone the repository.
  2. Install dependencies:
    pip install pandas openpyxl

About

Analyzing customer behavior and churn risk with RFM Segmentation. A data-driven approach to optimize marketing strategies using Python & Power BI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages