Skip to content

chandanc5525/MachineLearningModel_Deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Customer Churn Prediction App

Python Framework ML Package Manager License Status

End-to-end Machine Learning project for predicting customer churn.

Includes:

  • Data preprocessing

  • Model training (Random Forest)

  • Pickle model generation

  • Deployment using FastAPI, Flask, Streamlit, Gradio

  • HTML + CSS frontend


πŸš€ SETUP INSTRUCTIONS (STEP-BY-STEP)

1️⃣ Fork the repository (from GitHub UI)

2️⃣ Clone your fork

git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git

cd YOUR-REPO-NAME


3️⃣ Install uv (if not installed)


Mac / Linux

curl -Ls https://astral.sh/uv/install.sh | sh

Windows (PowerShell)

irm https://astral.sh/uv/install.ps1 | iex

Verify installation

uv --version


4️⃣ Create Virtual Environment


uv venv

Activate virtual environment

Windows

.venv\Scripts\activate

Mac / Linux

source .venv/bin/activate


5️⃣ Install Project Dependencies


uv sync


6️⃣ Train Model (Generate Pickle File)


Make sure dataset exists:

data/churn.csv

python train_model.py

This creates:

models/churn_model.pkl


🌐 RUN APPLICATIONS


▢️ Run Flask App


python deployments/flask/flask_app.py

Open in browser:


▢️ Run FastAPI App


uvicorn deployments.fastapi.fastapi_app:app --reload

Open:

Swagger Docs:


▢️ Run Streamlit App


streamlit run deployments/streamlit_app.py


▢️ Run Gradio App


python deployments/gradio_app.py


πŸ“‚ PROJECT STRUCTURE

.
β”œβ”€β”€ data/
β”‚   └── churn.csv
β”œβ”€β”€ models/
β”‚   └── churn_model.pkl
β”œβ”€β”€ deployments/
β”‚   β”œβ”€β”€ flask/
β”‚   β”œβ”€β”€ fastapi/
β”‚   β”œβ”€β”€ streamlit_app.py
β”‚   └── gradio_app.py
β”œβ”€β”€ train_model.py
β”œβ”€β”€ pyproject.toml
└── README.md


πŸ“Œ IMPORTANT NOTES

  • Train the model before running any app.

  • Entire preprocessing + model is saved inside pickle.

  • No manual encoding required in deployment.

  • SMOTE (if used) is only for training, never for production API.


🎯 DONE

You now have a fully working ML project with multiple deployment options.

About

End-to-end Machine Learning project for predicting customer churn.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors