Skip to content

eboekenh/Level_Based_Persona

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

👥 Level-Based Customer Persona Segmentation

Rule-based customer segmentation that creates level-based personas from demographic and behavioral data, then assigns revenue-based segment labels (A/B/C/D) for targeted marketing.

Python Pandas License

Problem Statement

Given user demographic data (country, device, gender, age) and purchase history, create meaningful customer segments that predict the expected revenue from new customers with similar profiles.

Approach

  1. Data Merging — Join user demographics with purchase records
  2. Revenue Aggregation — Calculate total revenue per demographic group
  3. Age Binning — Convert continuous age into categorical brackets: 0–18, 19–23, 24–30, 31–40, 41–75
  4. Persona Construction — Create composite keys like TUR_IOS_F_31_40 (Country_Device_Gender_Age)
  5. Revenue Scoring — Calculate mean revenue per persona
  6. Segmentation — Assign quartile-based segment labels using pd.qcut:
    • A — Top 25% revenue (highest value)
    • B — 50–75th percentile
    • C — 25–50th percentile
    • D — Bottom 25%

Use Case

Given a new customer profile (e.g., Turkish, iOS user, Female, age 41–75), the model instantly returns their expected segment and predicted revenue range — enabling personalized marketing and pricing strategies.

Tech Stack

  • Python 3.8+ — Core language
  • Pandas — Data manipulation, groupby aggregation, qcut segmentation

Getting Started

git clone https://github.com/eboekenh/Level_Based_Persona.git
cd Level_Based_Persona
pip install -r requirements.txt
python Level_based_persona.py

Place users.csv and purchases.csv in the project root before running.

License

MIT

About

Rule-based customer segmentation — level-based personas with revenue-driven A/B/C/D segments

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages