Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Abdullah321Umar/ElevvoPathways-DataAnalytics_Internship-TASK2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

17 Commits

Repository files navigation

Task 2 | Customer Segmentation Using RFM Analysis

Welcome to the Customer Segmentation Using RFM Analysis Project! This project focuses on analyzing customer purchasing behavior through the RFM (Recency, Frequency, Monetary) model, uncovering patterns that help businesses understand their customers better. By segmenting customers based on their buying habits, we aim to empower decision-makers with actionable insights for personalized marketing strategies and customer retention.


Project Snapshot:

Retail and e-commerce businesses generate massive amounts of transaction data daily . Analyzing this data with RFM provides powerful insights into who your best customers are, who needs attention, and who may be slipping away. In this project, we focused on:

  • Measuring Recency, Frequency, and Monetary value for each customer
  • Assigning RFM scores to categorize customers
  • Creating customer segments (Champions, Loyal, At Risk, Hibernating, etc.)
  • Building multiple visualizations (heatmaps, scatter plots, bar charts, etc.)
  • Suggesting targeted marketing strategies for each segment This project transforms raw sales transactions into a customer-centric view of business, enabling smarter decisions and long-term growth.

Objectives

  • Clean and preprocess the sales dataset for accurate analysis
  • Calculate RFM metrics for each customer
  • Assign RFM scores and create meaningful segments
  • Build visualizations to showcase patterns & clusters
  • Highlight customer behavior insights (best vs. risk customers)
  • Recommend marketing actions tailored to each segment

Tools & Technologies Used

  • Language: Python
  • Libraries: Pandas, NumPy, Seaborn, Matplotlib, Datetime
  • Analysis Methods: Descriptive Analysis | RFM Segmentation | Customer Analytics
  • Visualizations: Heatmaps | Line Charts | Bar Charts | Scatter Plots | Boxplots | Histograms | KPI-style summaries

Dataset Details:

The dataset contains transaction-level records of an online retail store, with the following key fields:

  • Invoice Date - Date of purchase
  • Invoice Number - Transaction ID
  • Customer ID - Unique customer identifier
  • Quantity & Unit Price - Purchase details
  • Total Sales - Derived from Quantity x Price

Workflow & Approach:

1 Data Preparation & Cleaning

  • Imported the dataset into Python (Pandas)
  • Removed missing values & cancelled invoices
  • Created new fields (e.g., TotalPrice)

2 RFM Feature Engineering

  • Recency - Days since last purchase
  • Frequency - Number of purchases made
  • Monetary - Total spending of each customer

3 Scoring & Segmentation

Assigned R, F, M scores (1-5) using quantiles Created a combined RFM Score (e.g., 555 = best customer) Classified customers into segments such as:

  • Champions
  • Loyal Customers
  • Potential Loyalists
  • At Risk
  • Hibernating

4 Visualization & Analysis

  • Created 10+ different visualizations, including:
  • Recency, Frequency, Monetary Distributions
  • RFM Correlation Heatmap
  • Segment-Wise Customer Count
  • Avg. Monetary Value per Segment
  • Scatter Plots (Recency vs Frequency, Monetary vs Frequency)
  • Boxplots of Monetary by Segment
  • Line Chart of Avg. RFM values per Segment

5 Insights & Strategy

Some key findings include:

  • Champions are the most valuable customers - Reward with loyalty programs & VIP offers
  • Loyal Customers shop frequently - Upsell & cross-sell relevant products
  • Potential Loyalists need nurturing - Send personalized promotions
  • At Risk Customers are slipping - Win-back campaigns with discounts
  • Hibernating Customers are inactive - Re-engage via awareness campaigns

Deliverables:

  • Cleaned Dataset - RFM_Cleaned.csv
  • Python Notebook - RFM_Analysis.ipynb
  • Segmentation Report - Customer_Segmentation_Report.docx / PDF
  • Visualizations - Heatmaps, Charts, and Segment Analysis

Conclusion:

This project demonstrates how RFM Analysis transforms raw retail data into customer-focused insights. By applying segmentation techniques and visualizing patterns, we can identify top customers, prevent churn, and design smarter marketing strategies. The result is a data-driven customer segmentation framework that helps businesses build stronger relationships, improve engagement, and maximize profitability.


Let's Connect:-


Task Statement:-


Plots Preview:-


About

Customer Segmentation Using RFM Analysis This project applies RFM (Recency, Frequency, Monetary) analysis to segment customers based on their purchasing behavior. Using Python (Pandas, Seaborn, Matplotlib), we calculated RFM scores and grouped customers into segments like Champions, Loyal, At Risk, and Hibernating.

Topics

Resources

Readme

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors