{"id":30732702,"url":"https://github.com/tszon/end-to-end_ds_ml_project","last_synced_at":"2026-04-16T10:01:47.123Z","repository":{"id":256488902,"uuid":"855454888","full_name":"Tszon/End-to-End_DS_ML_Project","owner":"Tszon","description":"I built an end-to-end customer churn segregation and prediction project.","archived":false,"fork":false,"pushed_at":"2025-08-26T11:44:44.000Z","size":16992,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T17:52:18.032Z","etag":null,"topics":["containerisation","data-science","docker","explianable-ai","exploratory-data-analysis","feature-engineering","hdbscan-clustering","kmeans-clustering","machine-learning","mlflow","preprocessing-data","scikit-learn","shap","statistical-test","statistical-tests","streamlit","supervised-learning","visualisation","vscode"],"latest_commit_sha":null,"homepage":"https://www.datacamp.com/portfolio/TszonTseng","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tszon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-10T22:29:43.000Z","updated_at":"2025-08-26T11:44:48.000Z","dependencies_parsed_at":"2024-09-11T03:39:17.357Z","dependency_job_id":"c8fb35d4-db81-4776-a20c-f193e098c8ce","html_url":"https://github.com/Tszon/End-to-End_DS_ML_Project","commit_stats":null,"previous_names":["tszon/data-science-projects"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Tszon/End-to-End_DS_ML_Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tszon%2FEnd-to-End_DS_ML_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tszon%2FEnd-to-End_DS_ML_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tszon%2FEnd-to-End_DS_ML_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tszon%2FEnd-to-End_DS_ML_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tszon","download_url":"https://codeload.github.com/Tszon/End-to-End_DS_ML_Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tszon%2FEnd-to-End_DS_ML_Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["containerisation","data-science","docker","explianable-ai","exploratory-data-analysis","feature-engineering","hdbscan-clustering","kmeans-clustering","machine-learning","mlflow","preprocessing-data","scikit-learn","shap","statistical-test","statistical-tests","streamlit","supervised-learning","visualisation","vscode"],"created_at":"2025-09-03T17:48:48.960Z","updated_at":"2026-04-16T10:01:47.111Z","avatar_url":"https://github.com/Tszon.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 End-to-End ML Deployment: Telco Customer Churn Project\n\n## 🌐 Live Demo\n\nClick 👉 [![Open in Streamlit](https://img.shields.io/badge/Streamlit-App-red?logo=streamlit)](https://tszontseng-telco-end2end-customer-churn-project.streamlit.app/)\n\n---\n\n## 📖 Project Overview\n\nCustomer churn is a major challenge for telecom companies — retaining customers is often more cost-effective than acquiring new ones.\nThis project builds an **end-to-end machine learning pipeline** to predict churn, explain drivers of churn, and segment customers into actionable groups for better retention strategies.\n\nThe project includes:\n\n* **EDA** → Explore churn patterns, tenure, contracts, charges.\n* **Customer Segmentation** → KMeans (baseline) vs HDBSCAN (tuned).\n* **Churn Prediction** → Logistic Regression baseline vs advanced ensemble models (Random Forest, XGBoost, Voting Classifier).\n* **Explainability** → SHAP summary \u0026 waterfall plots.\n* **Interactive App** → Built with **Streamlit**, deployed on Streamlit Cloud.\n\n---\n\n## 📂 Dataset\n\nDataset: [WA_Fn-UseC_-Telco-Customer-Churn.csv](https://www.kaggle.com/blastchar/telco-customer-churn)\n\n* **Target**: `\"Churn\"` (Yes/No)\n* **Features include**:\n\n  * **Demographics** → Gender, Senior Citizen, Dependents, Partner\n  * **Services** → Phone, Internet, Tech Support, Streaming, Security\n  * **Account Info** → Tenure, Contract, Billing, Payment Method\n  * **Charges** → Monthly \u0026 Total Charges\n\n---\n\n## 🧪 Methods \u0026 Models\n\n### 🔎 Exploratory Data Analysis (EDA)\n\n* Customers with **fiber optic internet churn the most** (pricing/service quality issues).\n* **DSL customers churn less**, possibly due to stable pricing or loyalty.\n* **High churn in first 5 months** → critical onboarding phase.\n* Long-tenure customers (\u003e24 months) show **significantly lower churn rates**.\n\n### 👥 Customer Segmentation (Unsupervised Learning)\n\n* **Cluster 0 — Budget Loyalists** → Minimal services, mailed check payments, stable.\n* **Cluster 1 — At-Risk Premiums** → Fiber optic, month-to-month, electronic check, highest churn risk.\n* **Cluster 2 — Balanced Mainstream** → Moderate DSL usage, mixed services, mid-spenders.\n* **Cluster -1 — Drifters** → DSL, no phone, low commitment.\n\n### 📊 Churn Prediction Models\n\n* Logistic Regression (baseline)\n* Random Forest (ensemble)\n* XGBoost (boosted trees)\n* Voting Classifier (combined)\n\n### 🔍 Explainability (SHAP)\n\n* Feature importance ranking.\n* SHAP summary plots + waterfall plots for individual predictions.\n\n---\n\n## 🚀 Deployment\n\n* **Streamlit App** for interactive visualization and prediction.\n* **Dockerized** for reproducibility.\n* **Deployed on Streamlit Cloud** with a public link.\n\n---\n\n## ⚙️ Installation \u0026 Usage\n\n### 1. Clone Repo\n\n```bash\ngit clone https://github.com/\u003cyour-username\u003e/Customer_Churn_Prediction.git\ncd Customer_Churn_Prediction\n```\n\n### 2. Install Requirements\n\n```bash\npip install -r requirements.txt\n```\n\n### 3. Run Locally\n\n```bash\nstreamlit run scripts/app.py\n```\n\nApp runs at: [http://localhost:8501](http://localhost:8501)\n\n### 4. Run with Docker\n\n```bash\ndocker build -t churn-app .\ndocker run -p 8501:8501 churn-app\n```\n\n---\n\n## 📦 Project Structure\n\n```\nCustomer_Churn_Prediction/\n│\n├── data/                 # feature store JSON (not raw data)\n├── models/               # saved ML models (.joblib)\n├── reports_app/          # plots \u0026 visualizations\n├── scripts/              # Streamlit app (app.py) \u0026 utilities\n├── src/                  # preprocessing, feature engineering, utils\n├── config.json           # config settings\n├── requirements.txt      # dependencies\n├── Dockerfile            # container setup\n└── README.md             # this file\n```\n\n---\n\n## 🛠️ Tech Stack\n\n* **Python**: `pandas`, `numpy`, `scikit-learn`, `xgboost`, `shap`, `hdbscan`, `umap`\n* **Visualization**: `matplotlib`, `seaborn`, `streamlit`\n* **MLOps Tools**: `Docker`, `GitHub`, `MLflow` (Experimental Tracking)\n* **Deployment**: `Streamlit Cloud`\n\n---\n\n## 📌 Next Steps\n\n* Extend segmentation with deep embeddings.\n* Add hyperparameter search with Optuna.\n* Deploy with a custom domain using Render or Railway.\n\n---\n\n## 👤 Author\n\nDeveloped by **[Tszon Tseng](https://github.com/Tszontseng)**\n\n* 💼 Passionate about Data Science \u0026 AI\n* 🚀 Building end-to-end ML pipelines\n* 🌐 [LinkedIn Profile](https://www.linkedin.com/in/tszon-tseng-a381aa297/)\n\n---\n\n✨ With this app, telecom providers can **predict churn, understand why customers leave, and design better retention strategies.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftszon%2Fend-to-end_ds_ml_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftszon%2Fend-to-end_ds_ml_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftszon%2Fend-to-end_ds_ml_project/lists"}