{"id":32342202,"url":"https://github.com/hq969/customer-churn-prediction-with-hyperparameter-optimization-and-model-deployment","last_synced_at":"2026-04-02T01:03:01.375Z","repository":{"id":302606127,"uuid":"1013014370","full_name":"hq969/Customer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment","owner":"hq969","description":"A complete end-to-end machine learning project that predicts customer churn using the Telco dataset. It includes data preprocessing, exploratory data analysis (EDA), model training with Random Forest, hyperparameter tuning, evaluation, and deployment via a Flask API.","archived":false,"fork":false,"pushed_at":"2025-07-03T09:07:15.000Z","size":409,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T15:30:44.219Z","etag":null,"topics":["flask","numpy","pandas","python","scikit-learn","xgboost"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hq969.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T08:24:10.000Z","updated_at":"2025-07-03T09:07:18.000Z","dependencies_parsed_at":"2025-07-03T09:40:28.213Z","dependency_job_id":null,"html_url":"https://github.com/hq969/Customer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment","commit_stats":null,"previous_names":["hq969/customer-churn-prediction-with-hyperparameter-optimization-and-model-deployment"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/hq969/Customer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2FCustomer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2FCustomer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2FCustomer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2FCustomer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hq969","download_url":"https://codeload.github.com/hq969/Customer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2FCustomer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","numpy","pandas","python","scikit-learn","xgboost"],"created_at":"2025-10-24T03:16:37.909Z","updated_at":"2026-04-02T01:03:01.355Z","avatar_url":"https://github.com/hq969.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"### 🔁 Customer Churn Prediction ML Pipeline\n\nThis project provides a **production-ready, end-to-end machine learning pipeline** for predicting customer churn using classification algorithms and modern data science tools. It includes **data preprocessing**, **EDA**, **model training**, **hyperparameter tuning**, **evaluation**, and **deployment via Flask API**.\n\n---\n\n## 📂 Project Structure\n\n```\n\nCustomer-Churn-Prediction-with-Hyperparameter-Optimization-and-Model-Deployment/\n│\n├── data/                          # Raw dataset\n│   └── churn_data.csv\n│\n├── src/                           # Core Python scripts\n│   ├── preprocessing.py           # Data loading and preprocessing\n│   ├── eda_visualization.py       # Data visualization functions\n│   ├── model_training.py          # Base ML training script\n│   ├── hyperparameter_tuning.py   # GridSearchCV optimization\n│   ├── model_evaluation.py        # Evaluation metrics and reports\n│   └── utils.py                   # Optional helper functions\n│\n├── app/\n│   └── app.py                     # Flask REST API for predictions\n│\n├── notebooks/\n│   └── churn_eda.ipynb            # Jupyter Notebook for EDA\n│\n├── models/\n│   └── churn_model.pkl            # Trained model saved with joblib\n│\n├── requirements.txt               # Python dependencies\n└── README.md                      # You're here\n\n````\n\n---\n\n## 📌 Objective\n\nTo develop a machine learning pipeline capable of predicting customer churn with high accuracy. The pipeline supports:\n- Feature engineering\n- Visualization\n- Model selection\n- Hyperparameter tuning\n- API deployment for real-world inference\n\n---\n\n## 💼 Use Case\n\n**Industry Example:** Telecom or subscription-based services\n\n**Business Value:** Helps reduce churn by identifying at-risk customers and enabling retention strategies like offers, feedback, and targeted communication.\n\n---\n\n## 🛠️ Tech Stack\n\n| Category               | Tools Used                          |\n|------------------------|-------------------------------------|\n| Programming Language   | Python                              |\n| Data Manipulation      | pandas, numpy                       |\n| Visualization          | seaborn, matplotlib                 |\n| ML Algorithms          | scikit-learn, XGBoost               |\n| Hyperparameter Tuning  | GridSearchCV                        |\n| Model Serialization    | joblib                              |\n| Deployment             | Flask                               |\n| Notebook Environment   | Jupyter Notebook                    |\n\n---\n\n## 📈 Model Training\n\nCurrently uses **Random Forest** and **XGBoost** as base classifiers. The training script can be extended to include other models.\n\n📂 `src/model_training.py` trains the model and saves it to `models/churn_model.pkl`.\n\n---\n\n## 🧪 Example Prediction API\n\nRun the API:\n```bash\ncd app/\npython app.py\n````\n\nTest using `curl` or Postman:\n\n```bash\ncurl -X POST http://127.0.0.1:5000/predict -H \"Content-Type: application/json\" \\\n-d '{\"features\": [0.0, 1.0, 45.0, 5000.0, 60.0, 1.0, 0.0]}'\n```\n\nResponse:\n\n```json\n{\n  \"churn_prediction\": 1\n}\n```\n\n---\n\n## 📦 Installation\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/yourusername/churn_ml_pipeline.git\ncd churn_ml_pipeline\n```\n\n### 2. Create Virtual Environment\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # Windows: venv\\Scripts\\activate\n```\n\n### 3. Install Requirements\n\n```bash\npip install -r requirements.txt\n```\n\n### 4. Run EDA Notebook\n\n```bash\njupyter notebook notebooks/churn_eda.ipynb\n```\n\n---\n\n## 📊 Dataset\n\nYou can use the **Telco Customer Churn dataset** from Kaggle or IBM:\n\n🔗 [Download Here (GitHub)](https://raw.githubusercontent.com/IBM/telco-customer-churn-on-icp4d/master/data/Telco-Customer-Churn.csv)\n\nSave as:\n\n```bash\ndata/churn_data.csv\n```\n\n---\n\n## 🧠 Model Insights\n\n* Handles numerical + categorical data\n* Supports hyperparameter tuning\n* Scalable for more complex models (e.g., neural networks)\n* Modular structure for experimentation\n\n---\n\n## 👨‍💻 Author\n\n**Harsh Sonkar**\nMachine Learning Engineer | Data Scientist\n[LinkedIn](https://www.linkedin.com/in/harsh-sonkar/) | [GitHub](https://github.com/harsh-sonkar)\n\n---\n\n## 🤝 Contributions\n\nPull requests are welcome! Please open an issue first to discuss what you would like to change.\n\n---\n\n## 📜 License\n\nThis project is licensed under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhq969%2Fcustomer-churn-prediction-with-hyperparameter-optimization-and-model-deployment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhq969%2Fcustomer-churn-prediction-with-hyperparameter-optimization-and-model-deployment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhq969%2Fcustomer-churn-prediction-with-hyperparameter-optimization-and-model-deployment/lists"}