Skip to content

BharathiDonku7/customer-behavior-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

🛒 Customer Behavior Prediction

Python Scikit-Learn Pandas Numpy Matplotlib Jupyter License

Predictive Modeling of Customer Behavior — Identifying potential buyers through purchase trend analysis and event-based behavioral patterns using machine learning classification.


📌 Overview

Understanding customer purchasing behavior is a key challenge in e-commerce, retail, and digital marketing. This project builds a machine learning model to predict whether a customer is likely to make a purchase, based on their browsing activity, event interactions, and purchase history.

This type of model directly supports:

  • 🎯 Targeted marketing campaigns — reach high-intent customers
  • 💼 Sales pipeline optimization — prioritize leads likely to convert
  • 📊 Customer segmentation — group users by purchase likelihood
  • 🏦 Financial analytics — mirrors expense behavior modeling at scale

🎯 Problem Statement

Given customer behavioral data:

Feature Description
Purchase Trends Historical buying patterns
Event Analysis User interaction events (clicks, views, add-to-cart)
Session Data Browsing session information
Demographics Customer profile attributes

Predict: Whether the customer is a potential buyer (1) or not (0)


🔍 Key Insights from EDA

  • 🛒 Customers who add items to cart are significantly more likely to purchase
  • 🔁 Repeat visitors have a much higher conversion rate than first-time visitors
  • 📅 Time of day and day of week influence purchase likelihood
  • 💰 Customers with higher session duration show stronger buying intent

🧠 ML Models Used

Model Description
Logistic Regression Baseline binary classifier
Decision Tree Rule-based interpretable model
Random Forest Ensemble method — best for feature importance
Gradient Boosting High-accuracy boosting classifier

📊 Model Performance

Model Accuracy AUC Score
Logistic Regression ~76% ~0.78
Decision Tree ~74% ~0.75
Random Forest ~84% ~0.87
Gradient Boosting ~86% ~0.89

🛠️ Tech Stack

Category Tools
Language Python
ML Models Scikit-Learn (Random Forest, Gradient Boosting, Logistic Regression)
Data Processing Pandas, NumPy
Feature Engineering Label Encoding, StandardScaler
Visualization Matplotlib, Seaborn
Environment Jupyter Notebook

🚀 Getting Started

Prerequisites

pip install pandas numpy scikit-learn matplotlib seaborn jupyter

Run the Notebook

jupyter notebook Customer_behavior.ipynb

💡 Key Steps in the Notebook

  • ✅ Loading and exploring customer behavioral dataset
  • ✅ Exploratory Data Analysis (EDA) — purchase trends & event patterns
  • ✅ Feature engineering — encoding behavioral signals
  • ✅ Training multiple ML classifiers
  • ✅ Model evaluation — accuracy, AUC, confusion matrix
  • ✅ Feature importance analysis — identifying top purchase drivers
  • ✅ Predictive system for new customer data

🔬 Connection to Real-World Finance & AI Work

This project directly reflects the type of behavioral analytics I build at Fifth Third Bank:

  • Purchase trend modeling — mirrors expense pattern analysis in commercial card pipelines
  • Event-based feature engineering — similar to real-time transaction flagging with Kafka & Spark
  • Classification pipelines — foundational to fraud detection and anomaly scoring models
  • Customer segmentation — applicable to personalized financial product recommendations

🤝 Connect With Me


"Building AI that's not just powerful, but trustworthy."

About

Predicting potential buyers using ML classification on purchase trends & event analysis — Gradient Boosting, Random Forest & ED

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors