{"id":26104049,"url":"https://github.com/rizz1406/customer-churn-analysis","last_synced_at":"2026-04-17T16:03:10.520Z","repository":{"id":281309374,"uuid":"944892134","full_name":"rizz1406/Customer-Churn-Analysis","owner":"rizz1406","description":"Telco Customer Churn Analysis - Data analysis and visualization to identify churn patterns in telecom customers. Includes EDA, feature engineering, and optional machine learning modeling to predict churn and provide business insights.","archived":false,"fork":false,"pushed_at":"2025-03-08T07:23:46.000Z","size":2388,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T08:20:08.508Z","etag":null,"topics":["churn-analysis","dataanalysis","dataanalysisusingpython","datacleaning","jupyter-notebook","python","visualization"],"latest_commit_sha":null,"homepage":"","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/rizz1406.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}},"created_at":"2025-03-08T07:07:52.000Z","updated_at":"2025-03-08T07:27:48.000Z","dependencies_parsed_at":"2025-03-08T08:20:24.757Z","dependency_job_id":"c6e314e7-ae3b-479a-bdd7-a6d89af53897","html_url":"https://github.com/rizz1406/Customer-Churn-Analysis","commit_stats":null,"previous_names":["rizz1406/customer-churn-analysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FCustomer-Churn-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FCustomer-Churn-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FCustomer-Churn-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FCustomer-Churn-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rizz1406","download_url":"https://codeload.github.com/rizz1406/Customer-Churn-Analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242750785,"owners_count":20179257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["churn-analysis","dataanalysis","dataanalysisusingpython","datacleaning","jupyter-notebook","python","visualization"],"created_at":"2025-03-09T21:01:05.932Z","updated_at":"2026-04-17T16:03:10.491Z","avatar_url":"https://github.com/rizz1406.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 Telco Customer Churn Analysis\n\n## 📌 Overview\nThis project analyzes customer churn in a **telecommunications company**. The dataset contains customer demographics, service usage, and contract details to identify patterns associated with churn.\n\nThe goal is to:\n- Perform **Exploratory Data Analysis (EDA)** to identify trends.\n- Handle **data preprocessing** and feature engineering.\n- Use **visualizations** for insights.\n- Optionally, apply **machine learning models** to predict churn.\n\n---\n\n## 🗂️ Dataset Description\nThe dataset includes:\n- **Customer ID**: Unique identifier.\n- **Demographics**: Gender, senior citizen status, partner, and dependents.\n- **Service Information**: Internet service, online security, streaming TV, etc.\n- **Contract Details**: Contract type, paperless billing, payment method.\n- **Churn Label**: Whether the customer left the service (`Yes` or `No`).\n\n📌 **Data Cleaning Steps:**\n- Handled missing values.\n- Converted categorical variables.\n- Engineered new features for analysis.\n\n---\n\n## ⚙️ Installation \u0026 Setup\n\n### **1️⃣ Clone the Repository**\n```bash\ngit clone https://github.com/rizz1406/Customer-Churn-Analysis.git\ncd Customer-Churn-Analysis\n```\n### **2️⃣ Install Dependencies**\nEnsure you have **Python 3.x** installed, then install required libraries:\n\n```bash\npip install pandas numpy matplotlib seaborn scikit-learn\n```\n\n### **3️⃣ Run the Jupyter Notebook**\n```bash\njupyter notebook\n```\nOpen `Telco Customer Churn.ipynb` and execute all cells.\n\n---\n\n## 🔍 Exploratory Data Analysis (EDA)\n\n### **1️⃣ Data Summary**\n```python\nimport pandas as pd\n\ndf = pd.read_csv(\"Customer Churn.csv\")\nprint(df.info())  # Dataset structure\nprint(df.describe())  # Statistical summary\nprint(df.isnull().sum())  # Check missing values\n```\n\n### **2️⃣ Churn Distribution**\n```python\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nplt.figure(figsize=(6,4))\nsns.countplot(x='Churn', data=df, palette='coolwarm')\nplt.title(\"Customer Churn Distribution\")\nplt.show()\n```\n📊 **Insight**: Helps understand the proportion of customers who churned vs. stayed.\n\n![image](https://github.com/user-attachments/assets/a8686301-fb13-4614-9ffd-bf8881a68886)\n\n---\n\n### **3️⃣ Correlation Heatmap**\n```python\nplt.figure(figsize=(10,6))\nsns.heatmap(df.corr(), annot=True, cmap='Blues')\nplt.title(\"Feature Correlation Heatmap\")\nplt.show()\n```\n📊 **Insight**: Identifies relationships between different variables.\n\n\n---\n\n## ✨ Feature Engineering\nSome feature transformations:\n- **Encoding categorical variables** (`Yes/No`, `Male/Female` → `0/1`).\n- **Creating new aggregated features**.\n- **Removing redundant columns**.\n\nExample transformation:\n```python\ndf['SeniorCitizen'] = df['SeniorCitizen'].map({0: 'No', 1: 'Yes'})\ndf = pd.get_dummies(df, drop_first=True)  # Convert categorical to numerical\n```\n\n---\n\n## 📈 Predicting Customer Churn (Optional)\n\n### **1️⃣ Splitting Data for Modeling**\n```python\nfrom sklearn.model_selection import train_test_split\n\nX = df.drop(columns=['Churn'])\ny = df['Churn']\n\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)\n```\n\n### **2️⃣ Applying a Machine Learning Model**\n```python\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import accuracy_score\n\nmodel = RandomForestClassifier(n_estimators=100, random_state=42)\nmodel.fit(X_train, y_train)\n\ny_pred = model.predict(X_test)\naccuracy = accuracy_score(y_test, y_pred)\nprint(f\"Model Accuracy: {accuracy:.2f}\")\n```\n📊 **Insight**: This gives a baseline model to predict churn.\n\n---\n\n## 📊 Key Visualizations\n\n### **1️⃣ Churn by Contract Type**\n```python\nplt.figure(figsize=(8,5))\nsns.countplot(x='Contract', hue='Churn', data=df)\nplt.title(\"Churn Rate by Contract Type\")\nplt.show()\n```\n📊 **Insight**: Customers with **month-to-month contracts** have a higher churn rate.\n\n![image](https://github.com/user-attachments/assets/3cc349f6-6e53-4882-aa9b-efe94bcf3ff6)\n\n### **2️⃣ Monthly Charges vs. Churn**\n```python\nplt.figure(figsize=(8,5))\nsns.boxplot(x=\"Churn\", y=\"MonthlyCharges\", data=df)\nplt.title(\"Monthly Charges vs Churn\")\nplt.show()\n```\n📊 **Insight**: Higher monthly charges correlate with increased churn.\n\n![image](https://github.com/user-attachments/assets/77dda908-1304-4d7b-a904-68d9edb191f1)\n\n---\n\n## 🏆 Results \u0026 Insights\n- **Customers with month-to-month contracts are more likely to churn.**\n- **Senior citizens have a slightly higher churn rate.**\n- **Paperless billing customers churn more frequently.**\n- **Long-term contract customers are more loyal.**\n\n📢 **Business Recommendation**: Offer incentives for long-term contracts to reduce churn.\n\n---\n\n## 🏗️ Future Improvements\n- ✅ Improve feature selection for better model accuracy.\n- ✅ Implement hyperparameter tuning for the ML model.\n- ✅ Deploy the model via Flask or Streamlit.\n\n---\n\n## 🤝 Contribution \u0026 License\n- Feel free to **contribute** by submitting pull requests.\n- Licensed under **MIT License**.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizz1406%2Fcustomer-churn-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frizz1406%2Fcustomer-churn-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizz1406%2Fcustomer-churn-analysis/lists"}