CoolFace
Apppublic

utanvir/telco_churn

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

Python ML Streamlit License: MIT

πŸ“‰ Telco Churn Prediction Dashboard

End-to-end machine learning pipeline for predicting customer churn using the Telco dataset. Includes preprocessing, model training, evaluation, and deployment via a Streamlit dashboard.


πŸŽ₯ Demo

[image]

πŸ”§ Features

  • β€”βš‘ Modular pipeline architecture (clean, reusable code)
  • β€”πŸ§Ή Preprocessing & feature engineering:
  • β€”Missing value handling
  • β€”Scaling, binning, one-hot encoding
  • β€”Polynomial & interaction features
  • β€”Feature selection with SelectKBest
  • β€”πŸ€– Model training with hyperparameter tuning:
  • β€”LogisticRegression
  • β€”RandomForest
  • β€”GradientBoostingClassifer
  • β€”AdaBoostClassifier
  • β€”SVC
  • β€”KNeighboursClassifier
  • β€”DecisionTreeClassifier
  • β€”GuassianNB
  • β€”MLPClassifier
  • β€”XGBoost
  • β€”πŸ“Š Evaluation metrics: Accuracy, Precision, Recall, F1, AUC-ROC
  • β€”πŸŽ›οΈ Interactive Streamlit dashboard:
  • β€”Exploratory Data Analysis (EDA)
  • β€”Model evaluation & visualization (Confusion Matrix, ROC Curve)
  • β€”Real-time churn predictions
  • β€”CSV export of predictions

πŸ“ Project Structure

churn-prediction-2/
β”œβ”€β”€ artifact/                     # Stores intermediate artifacts
β”œβ”€β”€ Chun_prediction.egg-info/     # Metadata for packaging
β”œβ”€β”€ logs/                         # Log files
β”œβ”€β”€ ml_venv/                      # Virtual environment (should be gitignored)
β”œβ”€β”€ notebook/                     # Jupyter notebooks
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── telco_churn.csv       # Dataset
β”‚   β”œβ”€β”€ eda.ipynb                 # Exploratory Data Analysis
β”‚   └── MODEL TRAINING.ipynb      # Model training notebook
β”œβ”€β”€ src/                          # Source code
β”‚   β”œβ”€β”€ components/               # Core components
β”‚   β”‚   β”œβ”€β”€ data_ingestion.py
β”‚   β”‚   β”œβ”€β”€ data_transformation.py
β”‚   β”‚   β”œβ”€β”€ model_trainer.py
β”‚   β”‚   └── __init__.py
β”‚   β”œβ”€β”€ pipeline/                 # Training & prediction pipelines
β”‚   β”‚   β”œβ”€β”€ train_pipeline.py
β”‚   β”‚   β”œβ”€β”€ predict_pipeline.py
β”‚   β”‚   └── __init__.py
β”‚   β”œβ”€β”€ exception.py              # Custom exception handling
β”‚   β”œβ”€β”€ logger.py                 # Logging utility
β”‚   β”œβ”€β”€ utils.py                  # Helper functions
β”‚   └── __init__.py
β”œβ”€β”€ templates/                    # Flask HTML templates
β”‚   β”œβ”€β”€ home.html
β”‚   └── index.html
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .python-version
β”œβ”€β”€ app.py                        # Flask entrypoint
β”œβ”€β”€ streamlit_app.py              # Streamlit dashboard
β”œβ”€β”€ requirements.txt              # Dependencies
β”œβ”€β”€ setup.py                      # Setup for packaging
└── README.md                     # Project documentation

πŸš€ How to Run

1. Clone the Repository

bash
git clone https://github.com/your-username/churn-prediction_v2.git
cd churn-prediction_v2

2. Install Dependencies

bash
pip install -r requirements.txt

3. Run Training Pipeline

bash
python -m src.pipeline.train_pipeline

4. Launch Streamlit Dashboard

streamlit run streamlit_app.py

πŸ“¦ Dependencies

  • β€”pandas
  • β€”matplotlib
  • β€”seaborn
  • β€”numpy
  • β€”scikit-learn==1.6.1
  • β€”imblearn
  • β€”xgboost
  • β€”dill
  • β€”Flask
  • β€”streamlit
  • β€”(See requirements.txt for full details)

πŸ“Š Dataset

This project uses the Telco Customer Churn dataset available at: Kaggle Telco Churn Dataset (https://www.kaggle.com/datasets/blastchar/telco-customer-churn)

πŸ“Œ License

MIT - You’re free to use, modify, and share it.

πŸ’‘ Future Improvements

  • β€”β˜οΈ Cloud deployment (Hugging Face, AWS, Heroku)
  • β€”πŸ”Ž AutoML (Optuna / RandomizedSearch)
  • β€”πŸ“‚ Handle unseen schema in uploaded CSVs
  • β€”πŸ“ˆ Real-time monitoring dashboard with Streamlit metrics

🀝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


πŸ”— Connect with me: LinkedIn | Instagram

utanvir/telco_churn Β· CoolFace