Skip to content

The goal of this project is to predict the likelihood of a Telco customer churning using Machine Learning techniques with Python and TensorFlow. This allows the company to implement retention strategies and reduce customer loss.

Notifications You must be signed in to change notification settings

QuantumRizo/Telco_Churn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Telco Customer Churn Prediction

πŸ“Œ Project Objective

The goal of this project is to predict the likelihood of a Telco customer churning using Machine Learning techniques with Python and TensorFlow. This allows the company to implement retention strategies and reduce customer loss.


πŸ—‚ Project Structure


Telco_Churn/
β”œβ”€ data/
β”‚ β”œβ”€ raw/ # Original dataset downloaded from Kaggle
β”‚ β”œβ”€ processed/ # Cleaned and transformed data
β”œβ”€ notebooks/
β”‚ └─ EDA.ipynb # Initial exploratory data analysis
β”œβ”€ src/
β”‚ β”œβ”€ preprocessing.py # Data cleaning and preprocessing functions
β”‚ β”œβ”€ model.py # Model definition and training
β”‚ β”œβ”€ evaluate.py # Model evaluation and metrics
β”‚ └─ visualize.py # Visualization functions (Precision-Recall curve)
β”œβ”€ outputs/
β”‚ β”œβ”€ figures/ # Generated plots
β”‚ └─ models/ # Saved trained models (.keras)
β”œβ”€ requirements.txt # Project dependencies
β”œβ”€ README.md # Project documentation
└─ run.py # Main script to execute the full pipeline

πŸ›  Tools and Libraries

  • Python 3.x
  • pandas, numpy
  • scikit-learn
  • TensorFlow
  • matplotlib

πŸ“ˆ Pipeline Overview

  1. Data Loading & Preprocessing

    • Load raw dataset and clean missing values.
    • Convert categorical variables using one-hot encoding.
    • Scale numerical features with StandardScaler.
  2. Model Training

    • Neural network built with TensorFlow/Keras.
    • Dense layers with ReLU activation and Dropout for regularization.
    • Binary classification using sigmoid output.
  3. Evaluation

    • Compute Precision, Recall, F1-score and ROC-AUC.
    • Calculate the best threshold to maximize F1-score.
  4. Visualization

    • Precision-Recall curve is saved in outputs/figures/.
    • Threshold that maximizes F1 is highlighted on the plot.
  5. Outputs

    • Trained model saved in outputs/models/.
    • Predictions can be exported for further analysis or Power BI dashboards.

πŸ“Š Metrics Example

After training, example results:

  • Accuracy: 0.76
  • ROC-AUC: 0.82
  • Best F1 Threshold: 0.54
  • Class 1 (Churners): Precision 0.53, Recall 0.74, F1 0.62

Precision-Recall Curve

Note: Metrics are computed on a hold-out test set. The threshold is optimized for business use-case to capture most churners while controlling false positives.


πŸš€ How to Run

  1. Clone the repository:
git clone https://github.com/quantumRizo/Telco_Churn.git

About

The goal of this project is to predict the likelihood of a Telco customer churning using Machine Learning techniques with Python and TensorFlow. This allows the company to implement retention strategies and reduce customer loss.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages