{"id":26412668,"url":"https://github.com/moustafamohamed01/mall-customer-segmentation-data","last_synced_at":"2026-05-08T01:31:41.314Z","repository":{"id":282190455,"uuid":"947759784","full_name":"MoustafaMohamed01/Mall-Customer-Segmentation-Data","owner":"MoustafaMohamed01","description":"Customer segmentation using K-Means clustering based on annual income and spending score.","archived":false,"fork":false,"pushed_at":"2025-03-13T08:18:39.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T09:23:27.626Z","etag":null,"topics":["data-science","data-visualization","k-means-clustering","machine-learning","python","scikit-learn","unsupervised-learning"],"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/MoustafaMohamed01.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-13T07:53:07.000Z","updated_at":"2025-03-13T08:22:11.000Z","dependencies_parsed_at":"2025-03-13T13:31:28.746Z","dependency_job_id":null,"html_url":"https://github.com/MoustafaMohamed01/Mall-Customer-Segmentation-Data","commit_stats":null,"previous_names":["moustafamohamed01/mall-customer-segmentation-data"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoustafaMohamed01%2FMall-Customer-Segmentation-Data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoustafaMohamed01%2FMall-Customer-Segmentation-Data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoustafaMohamed01%2FMall-Customer-Segmentation-Data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoustafaMohamed01%2FMall-Customer-Segmentation-Data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoustafaMohamed01","download_url":"https://codeload.github.com/MoustafaMohamed01/Mall-Customer-Segmentation-Data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244117652,"owners_count":20400743,"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":["data-science","data-visualization","k-means-clustering","machine-learning","python","scikit-learn","unsupervised-learning"],"created_at":"2025-03-17T22:08:26.339Z","updated_at":"2026-05-08T01:31:41.307Z","avatar_url":"https://github.com/MoustafaMohamed01.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Customer Segmentation using K-Means Clustering\n\n## Overview\nThis project performs customer segmentation using the K-Means clustering algorithm. It applies unsupervised learning to categorize customers based on their annual income and spending score.\n\n## Dataset\nThe project uses the **Mall_Customers.csv** dataset, which contains the following features:\n- **CustomerID**: Unique ID assigned to each customer.\n- **Gender**: Gender of the customer.\n- **Age**: Age of the customer.\n- **Annual Income (K$)**: Annual income of the customer in thousands.\n- **Spending Score (1-100)**: Score assigned by the mall based on customer behavior and spending patterns.\n\nDataset Source: [Kaggle - Mall Customers Dataset](https://www.kaggle.com/vjchoudhary7/customer-segmentation-tutorial-in-python).\n\n## Project Structure\n- **K-Means Clustering**: \n  - Determines the optimal number of clusters using the Elbow Method.\n  - Applies K-Means clustering to segment customers.\n  - Visualizes the clusters with a scatter plot.\n\n## Installation \u0026 Setup\n### Prerequisites\nEnsure you have Python installed along with the required dependencies:\n- **Using `pip` directly**:\n     ```sh\n     pip install numpy pandas seaborn matplotlib scikit-learn\n     ```\n - **Using `requirements.txt`** (recommended):\n  \n     ```sh\n     pip install -r requirements.txt\n     ```\n\n### Running the Script\n1. Clone the repository:\n   ```sh\n   git clone git@github.com:MoustafaMohamed01/Mall-Customer-Segmentation-Data.git\n   cd Mall-Customer-Segmentation-Data\n   ```\n2. Place the **Mall_Customers.csv** file in the same directory as the script.\n3. Run the Python script:\n   ```sh\n   python Customer_Segmentation_using_K-Means_Clustering.py\n   ```\n\n## Methodology\n1. **Load Data**: Reads the dataset into a Pandas DataFrame.\n2. **Data Preprocessing**: Extracts relevant features (Annual Income and Spending Score).\n3. **Finding Optimal Clusters**: Uses the **Elbow Method** to determine the best value of K.\n4. **Clustering with K-Means**: Applies K-Means with the optimal K value.\n5. **Visualization**: Plots the Elbow Graph and Cluster Scatter Plot.\n\n### **Elbow Method Graph**\nThe **Elbow Method** helps determine the optimal number of clusters by plotting the Within-Cluster Sum of Squares (WCSS).\n\n![Elbow Method Graph](images/elbow_point_graph.png)\n\n### **Customer Segmentation Scatter Plot**\nThe final K-Means clustering results are visualized in a scatter plot, showing customer segments and their centroids.\n\n![Customer Segmentation Plot](images/customer_segmentation.png)\n\n## Results \u0026 Insights\n- The optimal number of clusters (K) is selected using the **Elbow Method**.\n- Customers are grouped based on their **Annual Income** and **Spending Score**.\n- Business insights can be derived by analyzing these segments (e.g., targeting high-spending customers with promotions).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoustafamohamed01%2Fmall-customer-segmentation-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoustafamohamed01%2Fmall-customer-segmentation-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoustafamohamed01%2Fmall-customer-segmentation-data/lists"}