Skip to content

Shaikhasna/Telecom-Churn-Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telecom Churn Predictor

A machine learning project to predict customer churn for a telecom company. This project includes data preprocessing, exploratory data analysis (EDA), model training, evaluation, and a Streamlit web app for interactive predictions.

Features

  • Data Cleaning & Preprocessing: Handles missing values, encodes categorical variables, and scales numeric features.
  • Exploratory Data Analysis (EDA): Generates plots for churn distribution, numeric feature correlation, and other insights.
  • Machine Learning Models: Random Forest and XGBoost with hyperparameter tuning.
  • Imbalanced Data Handling: Uses SMOTE to balance classes.
  • Model Evaluation: Accuracy, ROC AUC, classification report, confusion matrix, and feature importance.
  • Web App: Streamlit app to input customer information and predict churn probability.

Installation

  1. Clone the repository:
    git clone https://github.com/Shaikhasna/Telecom-Churn-Predictor.git
    cd Telecom-Churn-Predictor
  2. Create and activate a virtual environment: python -m venv .venv ..venv\Scripts\activate # Windows source .venv/bin/activate # macOS/Linux
  3. Install dependencies: pip install -r requirements.txt

Usage

Run EDA python -m src.eda (Generates plots in the images/ directory.)

Train Model python -m src.train (Trains the model and saves it in models/churn_model.joblib.)

Evaluate Model python -m src.evaluate (Prints predictions and evaluation metrics.)

Run Streamlit App streamlit run app/streamlit_app.py (Open the app in your browser at http://localhost:8501.)

Folder Structure

telecom-churn/ │ ├── app/ # Streamlit app │ └── streamlit_app.py ├── src/ # Source code │ ├── eda.py │ ├── train.py │ ├── evaluate.py │ └── data_utils.py ├── models/ # Saved models ├── images/ # EDA and evaluation plots ├── .venv/ # Virtual environment ├── requirements.txt └── README.md

Author

Shaik Hasna

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages