Skip to content

End-to-end Telecom Churn Prediction app. Built with Statsmodels/Scikit-learn, deployed with FastAPI, and visualized with an animated HTML/JS dashboard.

Notifications You must be signed in to change notification settings

Navneet9788/Telecom-Churn-Prediction-App

Repository files navigation

Markdown

End-to-End Telecom Churn Prediction App

This project demonstrates a complete, full-stack Data Science application, deploying a highly interpretable Logistic Regression model as a live, interactive web service. It allows users to input customer features via an animated dashboard and receive a real-time churn risk assessment.


🚀 Key Features & Deployment Architecture

This project successfully integrates modeling (Statsmodels) with a high-performance serving stack (FastAPI/Uvicorn) and a professional front-end.

Component Technology Role
Modeling Python, Statsmodels, Scikit-learn Built and optimized the interpretable Logistic Regression model.
API Back-End FastAPI, Pydantic Serves real-time predictions with automatic validation and CORS handling (crucial for connecting the front-end).
Front-End HTML, JavaScript, TailwindCSS Developed a futuristic, animated dashboard with real-time risk gauge visualization.
Data Handling Serialization (Pickle, Joblib) Handled complex serialization of the statsmodels model and StandardScaler for deployment.

📂 Project Structure

This is the file structure of the repository:

Telecom Churn Project/ ├── app.py # The FastAPI server logic (model deployment) ├── churn_dashboard.html # The animated web interface (client) ├── Logistic Regression_self.ipynb # Model training & feature selection notebook ├── requirements.txt # Python dependency list ├── README.md # This file ├── .gitignore # Tells Git to ignore .pkl/.joblib files ├── *.csv (3 files) # Training data (e.g., churn_data.csv) └── .pkl/.joblib (4 files) # Model artifacts (Ignored by Git)


⚙️ How to Run Locally (Full Deployment Guide)

Prerequisites

  1. Python 3.8+
  2. Git (for repository management)

Steps:

1. Setup Environment

First, create and activate a virtual environment, then install all required packages:

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # macOS/Linux
venv\Scripts\activate     # Windows

# Install dependencies
pip install -r requirements.txt
2. Train Model & Generate Assets (Crucial Step)
You must run the entire Logistic Regression_self.ipynb notebook from start to finish. This step is mandatory as it executes the training and generates the three necessary deployment files (which end in .pkl and .joblib):

Model assets (e.g., final_churn_model.pkl, final_scaler.pkl, etc.)

3. Run the API Server
Start the FastAPI server on port 9090. Use the specified host and port to ensure the website connects correctly.

Bash

uvicorn app:app --host 0.0.0.0 --port 9090 --reload
(The server must remain running for the website to work.)

4. Access the Web Application
Open the churn_dashboard.html file directly in your web browser. The website will automatically connect to the running API on http://localhost:9090 to fetch predictions.

About

End-to-end Telecom Churn Prediction app. Built with Statsmodels/Scikit-learn, deployed with FastAPI, and visualized with an animated HTML/JS dashboard.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published