Customer Retention

Repeat Purchase Predictor

This project estimates whether a customer is likely to buy again, using a hybrid of RFM (Recency, Frequency, Monetary) and behavioral features.NOTE: First start the API to use the main UI: https://dikshajain2406-repeat-purchase-api.hf.space/docs (open this in your browser and then come here and view the project)

My Role

Data & Research Analyst - Research Work

Duration

3 Months

Tools

Python, FastAPI, Gradio, Pandas, Matplotlib, Hugging Face Spaces

Overview

To help beauty and fashion e-commerce brands identify customers likely to repurchase.
Existing dashboards lacked transparency — they showed results but not the logic behind predictions, making it hard for marketing teams to trust or act on insights.


Built a full-stack machine learning solution combining FastAPI (backend) and Gradio (frontend).
The system predicts customer repeat-purchase probability using a mix of RFM (Recency, Frequency, Monetary) metrics and behavioral features (returns, discounts, diversity).
The deployed demo gives instant CSV uploads, visual insights, and downloadable results for users and marketers.


Research

Research focused on customer retention patterns in lifestyle retail datasets (cosmetics, fashion, and e-commerce).
Findings showed that customers with frequent small purchases and low return rates are 2× more likely to repurchase, while discount dependence and limited category diversity reduce loyalty.

Key Drivers

Repeat purchases are primarily influenced by recency, monetary value, and category diversity.

Key Drivers

Repeat purchases are primarily influenced by recency, monetary value, and category diversity.

Key Drivers

Repeat purchases are primarily influenced by recency, monetary value, and category diversity.

Discount Sensitivity

Discount Sensitivity

Discount Sensitivity

Returns Impact

Returns Impact

Returns Impact

Design

Created a clean, pastel-themed Gradio UI to keep the focus on usability and transparency.
Each prediction is paired with charts showing probability distributions, customer segments, and behavioral breakdowns.
The API layer (FastAPI) ensures real-time scoring and scalability for batch processing.

Results

  • Improved prediction accuracy by 20% vs baseline RFM models.

  • Reduced analysis time from 2 hours to under 5 minutes through automated scoring.

  • Enabled data-driven loyalty segmentation for beauty and fashion retail use cases.

  • Deployed on Hugging Face Spaces, accessible to recruiters and collaborators without setup.

View More Work...

Customer Analytics | AI in Marketing

AI-Driven Consumer Segmentation Studio — Behavioral & RFM Analytics

Customer Analytics | AI in Marketing

AI-Driven Consumer Segmentation Studio — Behavioral & RFM Analytics

Customer Analytics | AI in Marketing

AI-Driven Consumer Segmentation Studio — Behavioral & RFM Analytics

Natural Language Processing (NLP) | E-commerce Analytics | Brand Intelligence

Hybrid Sentiment Analysis — Fashion & Cosmetics

Natural Language Processing (NLP) | E-commerce Analytics | Brand Intelligence

Hybrid Sentiment Analysis — Fashion & Cosmetics

Natural Language Processing (NLP) | E-commerce Analytics | Brand Intelligence

Hybrid Sentiment Analysis — Fashion & Cosmetics

Machine Learning | Time Series Forecasting | Retail Analytics

Retail Demand Forecasting

Machine Learning | Time Series Forecasting | Retail Analytics

Retail Demand Forecasting

Machine Learning | Time Series Forecasting | Retail Analytics

Retail Demand Forecasting

Social Media Analytics | Business Intelligence

Tech Brand Sentiment Analysis — Twitter Insights for Global Tech Brands

Social Media Analytics | Business Intelligence

Tech Brand Sentiment Analysis — Twitter Insights for Global Tech Brands

Social Media Analytics | Business Intelligence

Tech Brand Sentiment Analysis — Twitter Insights for Global Tech Brands

E-commerce Analytics / Beauty Industry Insights

Global Lifestyle & Cosmetics Analytics Dashboard

E-commerce Analytics / Beauty Industry Insights

Global Lifestyle & Cosmetics Analytics Dashboard

E-commerce Analytics / Beauty Industry Insights

Global Lifestyle & Cosmetics Analytics Dashboard

Create a free website with Framer, the website builder loved by startups, designers and agencies.