Watch a 30-second demo of Churn Shield's 3 core pages:
(Click to play video)
Churn Shield is an intelligent customer churn prediction application built with Streamlit and machine learning. It helps businesses identify customers who are likely to discontinue their services, enabling proactive retention strategies.
- ๐ฎ Smart Predictions: Predict customer churn with high accuracy using Random Forest classifier
- ๐ Visual Insights: Comprehensive data visualization and customer behavior analysis
- ๐๏ธ Interactive Interface: User-friendly web interface for easy data input and results
- ๐ Real-time Analytics: Instant prediction results with confidence scores
The application provides three main sections:
- ๐ Home: Introduction and dataset information
- ๐ Insights: Visual analysis of customer behavior patterns
- ๐ฏ Predict: Interactive prediction tool for individual customers
- Frontend: Streamlit
- Machine Learning: scikit-learn (Random Forest Classifier)
- Data Processing: Pandas, NumPy
- Visualization: Matplotlib, Seaborn
- Model Persistence: Pickle
Before running the application, ensure you have Python 3.8+ installed on your system.
git clone https://github.com/mustafarezk12/churn-shield.git
cd churn-shieldpip install -r requirements.txtstreamlit run app.pyThe application will open in your default web browser at http://localhost:8501
Create a requirements.txt file with the following dependencies:
streamlit>=1.28.0
pandas>=1.5.0
numpy>=1.24.0
scikit-learn>=1.3.0
matplotlib>=3.6.0
seaborn>=0.12.0
streamlit-option-menu>=0.3.6-
Navigate to the Predict tab
-
Enter customer details:
- Age: Customer's age (0-120)
- Gender: Male or Female
- Tenure: Months with the company (0-100)
- Usage Frequency: Monthly usage count
- Support Calls: Monthly support interactions
- Payment Delay: Days of payment delay
- Subscription Type: Basic, Standard, or Premium
- Contract Length: Monthly, Quarterly, or Annual
- Total Spend: Customer's total expenditure
- Last Interaction: Days since last contact
-
Click Predict to get instant results with confidence scores
The Insights section provides:
- Customer demographic distributions
- Subscription and contract analysis
- Support call patterns
- Interactive dashboard visualizations
The model uses 12 key features to predict customer churn:
| Feature | Description |
|---|---|
CustomerID |
Unique customer identifier |
Age |
Customer age |
Gender |
Customer gender |
Tenure |
Months as customer |
Usage Frequency |
Monthly usage count |
Support Calls |
Monthly support contacts |
Payment Delay |
Payment delay in days |
Subscription Type |
Service tier |
Contract Length |
Contract duration |
Total Spend |
Total customer expenditure |
Last Interaction |
Days since last contact |
Churn |
Target variable (0/1) |
- Algorithm: Random Forest Classifier
- Features: 10 input features (excluding CustomerID and Churn)
- Preprocessing: Standardization using mean and standard deviation
- Output: Binary classification with probability scores
The application features:
- Responsive Design: Works on desktop and mobile devices
- Interactive Navigation: Easy-to-use horizontal menu
- Visual Feedback: Color-coded prediction results
- Professional Styling: Clean and modern interface
churn-shield/
โโโDataset
| โโโ customer_churn_dataset-testing-master.csv
| โโโ customer_churn_dataset-training-master.csv
|
โโโEDA&ML-MODel
โโโ Full_Customer_Churn(1).ipynb # EDA & Trained/test ML model
โโโ Streamlit # Main Streamlit application
|___ |___ app.py
| |___ model(1).pkl # Trained ML model
| |___ exported_data.csv # Training dataset
| |___ mean_std_values.pkl # Normalization parameters
| |___ requirements.txt # Python dependencies
โโโ images
| โโโ LOGO.jpg # Application logo
| โโโ image.png # Prediction page image
| โโโ dash.PNG # Dashboard screenshot
โโโ README.md # Project documentation
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work - YourGitHub
- Dataset providers for the customer churn data
- Streamlit team for the amazing framework
- scikit-learn contributors for the machine learning tools
If you have any questions or run into issues, please:
- Check the Issues page
- Create a new issue if your problem isn't already reported
- Provide detailed information about your environment and the issue
Made with โค๏ธ and Python
โญ Star this repository if you found it useful!

