ποΈ Customer Segmentation using RFM Analysis and Clustering This project segments customers based on their purchasing behavior using RFM (Recency, Frequency, Monetary) analysis and clustering algorithms. It helps businesses identify different types of customers (e.g., loyal, lost, at-risk) and improve marketing strategies.
π Problem Statement "Segment customers of an online retail store based on their purchasing behavior using unsupervised learning. The goal is to discover meaningful groups like loyal customers, at-risk customers, and high spenders to enable targeted marketing."
π Dataset Name: Online Retail Dataset
Source: UCI Machine Learning Repository
Attributes:
InvoiceNo, StockCode, Description, Quantity, InvoiceDate, UnitPrice, CustomerID, Country
π§ Techniques Used π§Ό Data Cleaning
Removed canceled orders (InvoiceNo starting with "C")
Dropped rows with missing CustomerID
Removed rows with negative or zero Quantity or UnitPrice
π RFM Feature Engineering
Recency: Days since last purchase
Frequency: Number of unique purchases
Monetary: Total amount spent
π Unsupervised Clustering
k-Means with Elbow Method to determine optimal k
Cluster labeling: Champions, Loyal Customers, At Risk, Lost, etc.
π Visualization
3D Plot using Plotly
Cluster heatmaps, bar charts
π¦ Libraries Used bash Copy Edit pandas numpy matplotlib seaborn plotly scikit-learn ydata-profiling π Key Visuals π Elbow Curve to choose number of clusters
πΊ 3D Scatter Plot of RFM Clusters
π₯ Heatmap of average RFM values per segment