Skip to content

Elsayed-Elsherbiny/Customer-Churn-Prediction

Repository files navigation

📊 AI Customer Churn Prediction System

A Machine-Learning Powered Web Application for Real-Time Churn Risk Analysis


🚀 Introduction

Customer churn is one of the most critical challenges facing modern businesses. Losing customers directly impacts revenue, increases acquisition costs, and reduces long-term business stability.
To address this challenge, the AI Customer Churn Prediction System leverages machine learning and behavioral analytics to estimate the likelihood that a customer will leave (churn) and provides actionable insights to help businesses proactively retain customers.

This project implements a fully interactive Streamlit web application, powered by a trained K-Nearest Neighbors (KNN) classification model, supported by feature scaling and categorical encoding for highly accurate real-time predictions.


Problem Overview

Businesses struggle to answer key questions:

  • Which customers are most likely to leave?
  • Why are they leaving?
  • What actions can prevent churn?
  • How can we detect churn early—before it's too late?

Traditional systems rely on manual review and basic statistics, which are slow, inconsistent, and reactive.

As customer bases scale, this approach becomes ineffective.
Thus, identifying churn early using AI-driven predictive analytics becomes essential.


Proposed Solution

This project delivers a powerful AI-driven churn prediction system that solves the problem using:

🔹 1. Machine Learning Model (KNN)

  • Trained on real-world customer behavioral data.
  • Provides probability-based predictions.
  • Optimized through feature scaling and preprocessing.

🔹 2. Full Streamlit Web Application

The app allows users to:

  • Input customer attributes via an interactive survey-style interface.
  • Automatically encode and scale features.
  • Generate real-time churn probability (%) with a confidence score.
  • Visualize churn risk using a professional gauge chart.
  • Receive personalized, actionable recommendations.

🔹 3. Smart Interpretability Layer

The system offers:

  • Risk levels: Low, Medium, High
  • Behavioral insights
  • Practical recommendations based on customer profile

🌟 Key Contributions

1. End-to-End Churn Prediction Pipeline

Includes data preprocessing, feature engineering, scaling, encoding, model training, and evaluation.

2. Interactive Web Application

A professionally designed AI dashboard with:

  • Animated headers
  • Glassmorphism design
  • Dynamic forms
  • Real-time prediction engine
  • Gauge visualization (Plotly)

3. Robust Feature Processing

  • Transparent categorical encoding
  • Full numerical scaling with StandardScaler
  • Strict column ordering to match training schema

4. Deployed Live Application

Accessible online for anyone to test, requiring no installation.

5. Fully Documented Research Workflow

Includes:

  • Dataset exploration
  • Literature review survey
  • Experiments notebook
  • Final app deployment

📚 Resources & Project Files

📁 Dataset (Kaggle)

Customer Churn Prediction Dataset
🔗 https://www.kaggle.com/datasets/muhammadshahidazeem/customer-churn-dataset


📄 Survey / Literature Review

Google Colab Notebook
🔗 https://colab.research.google.com/drive/1kZ454r8JoRzbSX2-DOWJlfCYFt3RpTuH?usp=sharing


🧪 Machine Learning Experiments

Model Training, Evaluation, and Analysis
🔗 https://colab.research.google.com/drive/1iBXtht71wepp5cKUNxzH33rRXipmKFYm?usp=sharing


🌐 Live Demo (Streamlit App)

Try the churn prediction system now:
🔗 https://customer-churn-prediction-cc7prnhyleut3pmimklz9p.streamlit.app/


🏁 Conclusion

The AI Customer Churn Prediction System offers a comprehensive solution for businesses seeking to reduce churn and improve customer retention. By combining machine learning, real-time analytics, and modern UI design, this project demonstrates how predictive modeling can transform customer engagement strategies.

Feel free to fork the project, explore the notebooks, and enhance the model with additional experimentation.


About

A machine learning project to predict customer churn using historical data. It identifies customers likely to leave, helping businesses improve retention through data preprocessing, feature engineering, and model evaluation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors