{"id":35121528,"url":"https://github.com/anonymo2239/big-data-churn-analyzer","last_synced_at":"2026-05-21T02:33:40.523Z","repository":{"id":290822187,"uuid":"975667922","full_name":"anonymo2239/Big-Data-Churn-Analyzer","owner":"anonymo2239","description":"Scalable customer churn prediction using PySpark. Includes EDA, feature engineering, modeling, and real-time inference on new data.","archived":false,"fork":false,"pushed_at":"2025-05-25T14:41:04.000Z","size":1544,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-29T23:32:33.962Z","etag":null,"topics":["big-data","churn-analysis","churn-prediction","classification-algorithm","data-analysis","data-science","data-visualization","modeling","pyspark"],"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/anonymo2239.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-04-30T17:37:08.000Z","updated_at":"2025-05-25T14:47:25.000Z","dependencies_parsed_at":"2025-04-30T18:56:22.706Z","dependency_job_id":"1975de3c-ceff-4553-9fef-2674c4d9a199","html_url":"https://github.com/anonymo2239/Big-Data-Churn-Analyzer","commit_stats":null,"previous_names":["anonymo2239/big-data-churn-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anonymo2239/Big-Data-Churn-Analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymo2239%2FBig-Data-Churn-Analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymo2239%2FBig-Data-Churn-Analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymo2239%2FBig-Data-Churn-Analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymo2239%2FBig-Data-Churn-Analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anonymo2239","download_url":"https://codeload.github.com/anonymo2239/Big-Data-Churn-Analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonymo2239%2FBig-Data-Churn-Analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33286058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"online","status_checked_at":"2026-05-21T02:00:07.181Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["big-data","churn-analysis","churn-prediction","classification-algorithm","data-analysis","data-science","data-visualization","modeling","pyspark"],"created_at":"2025-12-28T00:04:45.113Z","updated_at":"2026-05-21T02:33:40.518Z","avatar_url":"https://github.com/anonymo2239.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customer Churn Prediction with PySpark\n\nThis project is a **customer churn prediction system** built using **Apache Spark**. The goal is to analyze customer behavior and predict the likelihood of churn using gradient boosting models (GBM) on tabular customer data.\n\n## Project Overview\n\nUsing **PySpark**, this project processes a dataset with customer attributes such as age, spending, and account tenure. The model classifies whether a customer will churn (leave) or stay.\n\n## Key Features\n\n* **PySpark-based scalable processing**\n* **Exploratory Data Analysis (EDA)** on customer data\n* **Feature engineering** (e.g., polynomial features)\n* **Gradient Boosted Tree Classifier** via `GBTClassifier`\n* **Hyperparameter tuning** with `CrossValidator` and `ParamGridBuilder`\n* **Churn prediction** for new (unseen) customer data\n\n## Dataset\n\n![Dataset](readme_images/dataset.png)\n\nEach row in the dataset represents a customer and includes:\n\n| Column            | Description                            |\n| ----------------- | -------------------------------------- |\n| `names`           | Customer name                          |\n| `age`             | Age of the customer                    |\n| `total_purchase`  | Total money spent                      |\n| `account_manager` | Whether an account manager is assigned |\n| `years`           | Number of years as a customer          |\n| `num_sites`       | Number of sites they use               |\n| `churn`           | 1 if churned, 0 otherwise              |\n\n## Exploratory Data Analysis (EDA)\n\n* Descriptive statistics for numeric columns\n* Class balance inspection\n* Distribution of variables by churn\n* Visualization with `seaborn.pairplot`\n\n![EDA Pairplot](readme_images/eda_pairplot.png)\n\n## Feature Engineering\n\n* Removed missing values\n* Added polynomial features (`age_square`)\n* Used `VectorAssembler` for machine learning input\n\n## Modeling\n\n* **Train-test split:** 70/30\n* **Classifier:** Gradient Boosted Tree (GBT)\n* **Tuning:** 10-fold cross-validation over:\n\n  * `maxDepth`: \\[2, 4, 6]\n  * `maxBins`: \\[20, 30]\n  * `maxIter`: \\[10, 20]\n\n```python\nGBTClassifier(maxIter=10, featuresCol=\"features\", labelCol=\"label\")\n```\n\n## Results\n\n* Accuracy on test set:  \n![test accuracy](readme_images/test_accuracy.png)\n\n## Inference on New Customers\n\nSample predictions for new customers with unseen data:\n\n| Name             | Prediction | Probability                |\n| ---------------- | ---------- | -------------------------- |\n| Ali Ahmetoğlu    | 1.0        | \\[0.20, 0.80] (will churn) |\n| Harika Gündüz    | 0.0        | \\[0.85, 0.15] (will stay)  |\n| Ata Bakmayan Ali | 0.0        | \\[0.99, 0.01] (will stay)  |\n\n## Technologies Used\n\n| Technology  | Purpose                                     |\n| ----------- | ------------------------------------------- |\n| **PySpark** | Distributed data processing and ML pipeline |\n| **Seaborn** | Visualization                               |\n| **Pandas**  | Data manipulation                           |\n| **Python**  | Core programming language                   |\n\n## Setup Instructions\n\n1. Install Spark and set environment variables (e.g., `SPARK_HOME`)\n2. Install dependencies:\n\n```bash\npip install pyspark findspark pandas seaborn\n```\n\n3. Place `churn.csv` in your project directory.\n4. Run the notebook or script.\n\n## Sample Commands\n\n```python\nimport findspark\nfindspark.init(\"C:\\\\spark\")  # Your Spark installation path\n```\n\n## Developers\n\n* **Alperen Arda** – [alperen.arda.adem22@gmail.com](mailto:alperen.arda.adem22@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonymo2239%2Fbig-data-churn-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanonymo2239%2Fbig-data-churn-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonymo2239%2Fbig-data-churn-analyzer/lists"}