This repository predicts telecom customer churn using supervised machine learning on the IBM Telco dataset.
Churn prediction is a high-impact telecom use case where recall-focused modeling helps prioritize retention actions and reduce customer loss.
- Python, pandas, numpy
- scikit-learn, XGBoost
- Jupyter Notebook workflow
git clone https://github.com/fbenkhelifa/telecom-customer-churn-ml.git
cd telecom-customer-churn-ml
python -m venv .venv
# Windows PowerShell
.\.venv\Scripts\Activate.ps1
pip install pandas numpy scikit-learn xgboost matplotlib seaborn jupyter
# bootstrap dataset into data/raw/telco/
powershell -ExecutionPolicy Bypass -File scripts/download_data.ps1jupyter notebook notebooks/churn-prediction.ipynbRun cells top-to-bottom.
- Source: IBM Telco Customer Churn
- Rows: 7043
- Features: 21
- Target:
Churn(Yes/No) - Local path used by notebook:
../data/raw/telco/WA_Fn-UseC_-Telco-Customer-Churn.csv
- Logistic Regression (tuned): Recall 86.8%
- XGBoost (tuned): Recall 80.3%
telecom-customer-churn-ml/
├── data/
│ ├── README.md
│ ├── raw/
│ │ └── telco/
│ │ └── WA_Fn-UseC_-Telco-Customer-Churn.csv
│ └── processed/
├── notebooks/
│ └── churn-prediction.ipynb
├── reports/
│ └── telecom-customer-churn-ml.pdf
├── src/
│ └── .gitkeep
├── scripts/
│ └── download_data.ps1
├── README.md
├── .gitignore
└── LICENSE
- Notebook-first format (limited modularization/reusability)
- No packaged training/inference CLI
- No automated tests or CI pipeline
- Refactor into modular Python package (
src/,notebooks/,data/). - Add reproducible dependency lock file.
- Add threshold optimization and cost-sensitive evaluation.
- Add baseline model serving API for churn scoring.
Licensed under MIT. See LICENSE.