FLO, an OmniChannel shoe retailer, wants to segment its customers and define marketing strategies according to these segments. To this end, the shopping behaviors of customers will be defined, and groups will be formed based on these behavioral clusters using RFM Analysis.
- To understand customer behavior using Recency, Frequency, and Monetary metrics.
- To create actionable customer segments (e.g., Champions, Hibernating, At Risk).
- To generate specific customer lists for targeted marketing campaigns.
The dataset consists of information obtained from the past shopping behaviors of customers who made their last purchases in 2020–2021 via OmniChannel (both online and offline).
| Variable | Description |
|---|---|
master_id |
Unique customer number |
order_channel |
Channel used for shopping (Android, iOS, Desktop, Mobile, Offline) |
last_order_channel |
Channel where the last purchase was made |
first_order_date |
Date of the customer's first purchase |
last_order_date |
Date of the customer's last purchase |
order_num_total_ever_online |
Total number of purchases on the online platform |
order_num_total_ever_offline |
Total number of purchases on the offline platform |
customer_value_total_ever_offline |
Total fee paid for offline purchases |
customer_value_total_ever_online |
Total fee paid for online purchases |
interested_in_categories_12 |
List of categories shopped in the last 12 months |
-
Data Preparation:
- Handling missing values and outliers.
- Creating new metrics:
Total Order Number&Total Spending. - Date format conversions.
-
Calculating RFM Metrics:
- Recency: How recently did the customer purchase? (Analysis Date - Last Order Date)
- Frequency: How often do they purchase? (Total Transaction Count)
- Monetary: How much do they spend? (Total Price)
-
Calculating RFM Scores:
- Metrics are converted to scores from 1 to 5.
RFM_SCOREis derived by combining Recency and Frequency scores.
-
Segmentation:
- Customers are mapped to segments like "Champions", "Loyal Customers", "Hibernating" based on regex mapping of their scores.
Here is the summary of the customer segments identified:
Insights:
- Champions: There are 1,932 customers who shop frequently and recently.
- Cant_Loose: 1,200 customers have high purchase frequency but haven't visited recently. They need immediate attention.
- Hibernating: A large portion (3,604) of the customer base is inactive.
Objective: Target loyal customers (Champions, Loyal Customers) who are interested in the "WOMEN" category for a premium brand launch.
- Action: - Segments:
Champions,Loyal_Customers- Category Interest:
KADIN - Output:
new_brand_target_customer_id.csv
- Category Interest:
Objective: Reactivate lost customers and reward new ones interested in "MEN" or "CHILDREN" categories with a 40% discount.
- Action: - Segments:
Cant_Loose,Hibernating,New_Customers- Category Interest:
ERKEK,COCUK - Output:
discount_target_customer_id.csv
- Category Interest:
-
Clone the repository:
git clone [https://github.com/merttdmrr/FLO-RFM-Customer-Segmentation.git](https://github.com/merttdmrr/FLO-RFM-Customer-Segmentation.git)
-
Install the requirements:
pip install -r requirements.txt- Run the Jupyter Notebook.
Mert Can Demir
