{"id":18106905,"url":"https://github.com/kfrural/customer-churn-prediction","last_synced_at":"2026-04-29T01:34:18.473Z","repository":{"id":259444898,"uuid":"877570023","full_name":"kfrural/customer-churn-prediction","owner":"kfrural","description":"Customer churn prediction using machine learning. The project follows CRISP-DM and KDD methodologies, including data preprocessing, feature engineering, modeling, and evaluation. It also features an interactive dashboard for visualizing results.","archived":false,"fork":false,"pushed_at":"2024-10-24T11:35:57.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T06:45:58.760Z","etag":null,"topics":["crisp-dm","data","jupyter","kdd","python"],"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/kfrural.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}},"created_at":"2024-10-23T22:03:23.000Z","updated_at":"2024-11-01T10:00:15.000Z","dependencies_parsed_at":"2024-10-25T13:35:56.102Z","dependency_job_id":"c637712b-e56e-4729-8754-15e67644b279","html_url":"https://github.com/kfrural/customer-churn-prediction","commit_stats":null,"previous_names":["kfrural/customer-churn-prediction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kfrural/customer-churn-prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrural%2Fcustomer-churn-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrural%2Fcustomer-churn-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrural%2Fcustomer-churn-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrural%2Fcustomer-churn-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfrural","download_url":"https://codeload.github.com/kfrural/customer-churn-prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfrural%2Fcustomer-churn-prediction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32407164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"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":["crisp-dm","data","jupyter","kdd","python"],"created_at":"2024-10-31T23:08:29.012Z","updated_at":"2026-04-29T01:34:18.455Z","avatar_url":"https://github.com/kfrural.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customer Churn Prediction\n\nThis project aims to predict customer churn for a telecom company using machine learning techniques. By leveraging two methodologies, **CRISP-DM** and **KDD**, we ensure a structured and insightful approach to the data mining process. The project includes data preprocessing, feature engineering, modeling, and evaluation phases, and is supported by a deployable dashboard for presenting the results.\n\n## Project Overview\n\n- **Objective**: Predict whether a customer will churn (leave the company) based on historical customer data.\n- **Dataset**: Telecom customer churn data containing demographic information, customer behavior, and churn status.\n- **Methodologies**:\n  - **CRISP-DM**: Cross Industry Standard Process for Data Mining.\n  - **KDD**: Knowledge Discovery in Databases.\n\n## Directory Structure\n\n```plaintext\n/customer-churn-prediction\n│\n├── /data\n│   ├── telecom_churn_data.csv           # Dataset for customer churn\n│\n├── /notebooks\n│   ├── 01_data_understanding.ipynb      # Data exploration and understanding\n│   ├── 02_data_preprocessing.ipynb      # Data cleaning and preprocessing\n│   ├── 03_feature_engineering.ipynb     # Feature selection and engineering\n│   ├── 04_modeling.ipynb                # Model training and tuning\n│   ├── 05_evaluation.ipynb              # Model evaluation and validation\n│\n├── /src\n│   ├── data_preprocessing.py            # Data preprocessing script\n│   ├── feature_engineering.py           # Feature engineering script\n│   ├── modeling.py                      # Modeling script\n│   ├── evaluation.py                    # Model evaluation script\n│\n├── /dashboard\n│   ├── app.py                           # Dashboard for result visualization\n│\n├── /docs\n│   ├── CRISP_DM_overview.md             # Overview of CRISP-DM methodology\n│   ├── KDD_overview.md                  # Overview of KDD methodology\n│   ├── Project_Plan.md                  # Project plan and methodology documentation\n│\n├── README.md                            # Project overview and instructions\n├── requirements.txt                     # List of Python dependencies\n└── LICENSE                              # License for the project\n```\n\n## Workflow\n\n### 1. **Data Understanding**\nThe initial phase involves exploring the data to understand key attributes and relationships. The dataset includes features such as:\n\n- **Customer Demographics**: Gender, SeniorCitizen, tenure.\n- **Service Information**: MonthlyCharges, total service usage.\n- **Churn Status**: Whether the customer left the company or not.\n\nExploration results are documented in `01_data_understanding.ipynb`.\n\n### 2. **Data Preprocessing**\nCleaning and preparing the data for modeling. This includes:\n\n- Handling missing values.\n- Encoding categorical variables.\n- Normalizing or scaling numeric data.\n  \nDetails in `02_data_preprocessing.ipynb` and `data_preprocessing.py`.\n\n### 3. **Feature Engineering**\nNew features are derived to improve model performance:\n\n- Interaction features (e.g., tenure * monthly charges).\n- Aggregations or groupings based on customer type.\n\nMore details in `03_feature_engineering.ipynb` and `feature_engineering.py`.\n\n### 4. **Modeling**\nSeveral machine learning models are tested, including:\n\n- Logistic Regression\n- Random Forest\n- XGBoost\n\nModel training, cross-validation, and hyperparameter tuning are performed to identify the best model.\n\nCheck `04_modeling.ipynb` and `modeling.py` for implementation.\n\n### 5. **Evaluation**\nThe best-performing models are evaluated using:\n\n- Accuracy, Precision, Recall, and F1-Score.\n- Confusion Matrix.\n- ROC and AUC metrics.\n\nResults are recorded in `05_evaluation.ipynb` and `evaluation.py`.\n\n### 6. **Dashboard**\nA simple interactive dashboard is developed using `Plotly Dash` to visualize the model's performance, important features, and predictions.\n\nCheck the `dashboard/app.py` for the dashboard setup.\n\n## Technologies Used\n\n- **Python**: Core programming language.\n- **Pandas**: Data manipulation and analysis.\n- **Scikit-learn**: Machine learning models and utilities.\n- **XGBoost**: Advanced gradient boosting models.\n- **Plotly Dash**: Dashboard development.\n- **Jupyter Notebooks**: For interactive data exploration and model building.\n\n## Setup Instructions\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/your-username/customer-churn-prediction.git\n    cd customer-churn-prediction\n    ```\n\n2. Create a virtual environment and install dependencies:\n\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n    pip install -r requirements.txt\n    ```\n\n3. Download the dataset and place it in the `/data` folder (or use the example `telecom_churn_data.csv` provided).\n\n4. Run the notebooks to explore the data and train the models:\n\n    ```bash\n    jupyter notebook\n    ```\n\n5. Run the dashboard for visualizing the results:\n\n    ```bash\n    python dashboard/app.py\n    ```\n\n## Results\n\n- **Best Model**: XGBoost\n- **Key Metrics**:\n  - Accuracy: 85%\n  - Precision: 82%\n  - Recall: 78%\n  - F1-Score: 80%\n- **Feature Importance**: Tenure, Monthly Charges, Contract Type were found to be the most predictive features.\n\n## Future Work\n\n- Improve model interpretability using SHAP or LIME.\n- Extend dashboard for real-time monitoring of churn predictions.\n- Experiment with deep learning models for further improvements.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfrural%2Fcustomer-churn-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfrural%2Fcustomer-churn-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfrural%2Fcustomer-churn-prediction/lists"}