Skip to content

This notebook focuses on RFM (Recency, Frequency, Monetary) segmentation, a popular method used in customer analysis to group customers based on their purchasing behavior. The key goal of RFM segmentation is to identify different customer segments by analyzing their transaction history and assigning them to categories based on their recency of purc

Notifications You must be signed in to change notification settings

M3GHAN/RFM-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

RFM Segmentation with Equal-Width and Equal-Frequency Binning

Overview

This project demonstrates how to perform RFM (Recency, Frequency, Monetary) segmentation using equal-width binning. The process includes loading data, calculating RFM metrics, and applying binning techniques to segment the data effectively.

Features

  • Equal-Width Binning: The data is segmented into equal-width bins using pd.cut(), allowing us to categorize the data points based on their RFM scores.
  • Pivot Table Creation: A pivot table is used to count the occurrences of each bin, providing insight into the distribution of the segments.
  • Visualization: The data is visualized using Matplotlib or Seaborn to show the distribution of the segments.

Steps in the Notebook

  1. Load Your Data: Ensure you have a DataFrame with the necessary data for analysis.
  2. Calculate Equal-Width Bins: Use pd.cut to divide the data into equal-width bins based on RFM metrics.
  3. Create a Pivot Table: Organize the data into a pivot table to count the distribution of RFM segments.
  4. Visualize the Data: Generate visualizations to better understand the distribution of your segments.

Prerequisites

  • Python 3.x
  • Libraries:
    • pandas
    • numpy
    • seaborn
    • matplotlib

How to Run

  1. Clone the repository.
  2. Install the necessary libraries using:
    pip install -r requirements.txt
  3. Open the RMF_EW_EF.ipynb notebook in Jupyter Notebook or Google Colab.
  4. Run the cells to reproduce the results.

Results

After running the notebook, you will be able to visualize the distribution of customers or data points based on the RFM segmentation, helping you to gain insights into customer behavior or any segmented data.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This notebook focuses on RFM (Recency, Frequency, Monetary) segmentation, a popular method used in customer analysis to group customers based on their purchasing behavior. The key goal of RFM segmentation is to identify different customer segments by analyzing their transaction history and assigning them to categories based on their recency of purc

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published