{"id":21513804,"url":"https://github.com/ebadshabbir/k-means-clustering","last_synced_at":"2026-05-06T08:32:27.229Z","repository":{"id":263959449,"uuid":"891912531","full_name":"EbadShabbir/K-Means-Clustering","owner":"EbadShabbir","description":"This repository demonstrates the implementation of the K-Means clustering algorithm to segment mall customers based on their annual income and spending behavior. By identifying distinct customer clusters, businesses can gain insights into customer groups and create targeted marketing strategies to improve customer engagement.","archived":false,"fork":false,"pushed_at":"2024-11-21T07:25:56.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T10:07:29.951Z","etag":null,"topics":["clustering","jupyter-notebook","k","kmeans-clustering","machine-learning","matplotlib-pyplot","pandas","python","sckit-learn"],"latest_commit_sha":null,"homepage":"https://www.kaggle.com/code/ebadshabbir/k-means-clustering","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/EbadShabbir.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":"2024-11-21T07:18:26.000Z","updated_at":"2024-11-21T07:28:12.000Z","dependencies_parsed_at":"2024-11-21T08:35:34.118Z","dependency_job_id":null,"html_url":"https://github.com/EbadShabbir/K-Means-Clustering","commit_stats":null,"previous_names":["ebadshabbir/k-means-clustering"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EbadShabbir/K-Means-Clustering","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbadShabbir%2FK-Means-Clustering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbadShabbir%2FK-Means-Clustering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbadShabbir%2FK-Means-Clustering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbadShabbir%2FK-Means-Clustering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EbadShabbir","download_url":"https://codeload.github.com/EbadShabbir/K-Means-Clustering/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbadShabbir%2FK-Means-Clustering/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262235783,"owners_count":23279567,"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":["clustering","jupyter-notebook","k","kmeans-clustering","machine-learning","matplotlib-pyplot","pandas","python","sckit-learn"],"created_at":"2024-11-23T23:17:23.636Z","updated_at":"2026-05-06T08:32:27.190Z","avatar_url":"https://github.com/EbadShabbir.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mall Customers Clustering using K-Means\n\nThis project demonstrates the implementation of K-Means clustering on a dataset of mall customers to group them based on their annual income and spending score.\n\n---\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Requirements](#requirements)\n- [Dataset](#dataset)\n- [Implementation](#implementation)\n- [Visualization](#visualization)\n- [Results](#results)\n- [Usage](#usage)\n- [Author](#author)\n- [License](#license)\n\n---\n\n## Introduction\nK-Means is an unsupervised learning algorithm used for clustering. This project applies the algorithm to customer data to identify distinct groups of customers based on their income and spending behavior. These clusters can help businesses tailor their strategies to target specific customer segments.\n\n---\n\n## Requirements\nEnsure the following Python libraries are installed:\n- **Python 3.x**\n- **NumPy**\n- **Pandas**\n- **Matplotlib**\n- **Scikit-learn**\n\n## Dataset\nThe dataset used in this project is the Mall Customers dataset. It contains the following columns:\n\nCustomerID: Unique identifier for each customer\nGender: Gender of the customer\nAge: Age of the customer\nAnnual Income (k$): Annual income of the customer in thousands of dollars\nSpending Score (1-100): Spending behavior score\nEnsure the dataset is saved as Mall_Customers.csv in the correct directory.\n\n## Implementation\nThe code is divided into the following steps:\n\nImport Libraries:\nNecessary libraries for data manipulation, visualization, and machine learning are loaded.\n\nLoad Dataset:\nThe dataset is read into a Pandas DataFrame for analysis.\n\nFeature Selection:\nThe features Annual Income and Spending Score are selected as inputs for clustering.\n\nElbow Method:\nThe elbow method is used to determine the optimal number of clusters. This is done by plotting the Within-Cluster Sum of Squares (WCSS) for different cluster counts.\n\nTrain K-Means Model:\nThe K-Means algorithm is applied with the optimal number of clusters determined in the previous step.\n\nCluster Visualization:\nThe customer clusters are visualized in a scatter plot with cluster centroids.\n\n## Visualization\n1. Elbow Method\nThe elbow method helps identify the optimal number of clusters by plotting the WCSS against the number of clusters. The \"elbow point\" on the graph indicates the best number of clusters.\n\n\n2. Customer Clusters\nThe scatter plot below visualizes the clusters of customers. Each color represents a distinct cluster, and the yellow points mark the centroids.\n\n## Results\nOptimal Clusters\nUsing the elbow method, the optimal number of clusters is determined to be 5.\n\nCluster Insights\nThe clusters represent distinct customer segments:\n\nCluster 1 (Blue): High income, low spending.\nCluster 2 (Red): High income, high spending.\nCluster 3 (Green): Moderate income, moderate spending.\nCluster 4 (Pink): Low income, high spending.\nCluster 5 (Cyan): Low income, low spending.\n## Usage\nThe identified clusters can help businesses:\n\nCustomize marketing strategies.\nImprove customer satisfaction by understanding customer behavior.\nOptimize resource allocation for targeted marketing campaigns.\n\n\nInstall the required libraries using:\n```bash\npip install numpy pandas matplotlib scikit-learn\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febadshabbir%2Fk-means-clustering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febadshabbir%2Fk-means-clustering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febadshabbir%2Fk-means-clustering/lists"}