{"id":27957488,"url":"https://github.com/muhammadfahd/customer_segmentation_using_kmeans","last_synced_at":"2026-05-06T18:36:09.423Z","repository":{"id":291347183,"uuid":"977351412","full_name":"muhammadfahd/customer_segmentation_using_kmeans","owner":"muhammadfahd","description":"mini machine learning project (unsupervised learning type) that uses K-Means clustering to segment mall customers based on their annual income and spending score. With proper guide and code. Build with Streamlit for UI.","archived":false,"fork":false,"pushed_at":"2025-05-04T02:14:21.000Z","size":557,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T18:13:18.661Z","etag":null,"topics":["huggingface-spaces","machine-learning","python","streamlit","unsupervised-clustering"],"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/muhammadfahd.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,"zenodo":null}},"created_at":"2025-05-04T02:07:43.000Z","updated_at":"2025-05-04T02:15:04.000Z","dependencies_parsed_at":"2025-05-04T03:24:04.731Z","dependency_job_id":"b3db7b23-1bf4-40b3-9a41-e37b68c22712","html_url":"https://github.com/muhammadfahd/customer_segmentation_using_kmeans","commit_stats":null,"previous_names":["muhammadfahd/customer_segmentation_using_kmeans"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muhammadfahd/customer_segmentation_using_kmeans","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadfahd%2Fcustomer_segmentation_using_kmeans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadfahd%2Fcustomer_segmentation_using_kmeans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadfahd%2Fcustomer_segmentation_using_kmeans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadfahd%2Fcustomer_segmentation_using_kmeans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadfahd","download_url":"https://codeload.github.com/muhammadfahd/customer_segmentation_using_kmeans/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadfahd%2Fcustomer_segmentation_using_kmeans/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267141156,"owners_count":24041982,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","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":["huggingface-spaces","machine-learning","python","streamlit","unsupervised-clustering"],"created_at":"2025-05-07T18:13:16.663Z","updated_at":"2026-05-06T18:36:09.385Z","avatar_url":"https://github.com/muhammadfahd.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛍️ Customer Segmentation using K-Means Clustering\nThis project is a customer segmentation analysis using K-means clustering. The goal is to divide customers into distinct groups based on their annual income and spending score to help businesses make targeted marketing decisions.\nThis repo contain following \n* [Unsuervised Learning K-means Clustering in Detail](./unsupervised%20learning%20kmeans%20clustering.md)\n* Implementing k-means clustering using \n  * [Built from scratch](https://github.com/muhammadfahd/customer_segmentation_using_kmeans/blob/main/k_measn_from_scratch.py) \n  * [using scikit library](https://github.com/muhammadfahd/customer_segmentation_using_kmeans/blob/main/k_means_using_scikit.py)\n* [Building a project with customer segmentation](./customer_Segmentation.ipynb)\n* Streamit Lit App [Link](https://huggingface.co/spaces/mfahadkhan/cutsomer_segmentation)\n---\n## 🧑‍💻 K-Means Clustering Algorithm\nK-means clustering is an unsupervised machine learning algorithm used to partition data into K distinct clusters. The objective of the algorithm is to minimize the within-cluster variance, so the points within each cluster are as similar as possible.\nFor detailed checkout [here](./unsupervised%20learning%20kmeans%20clustering.md)\n\n## 🧑‍💻 Implementation\n1. **K-Means Clustering from Scratch**\nWe start by implementing K-means clustering from scratch to understand the internal workings of the algorithm [here](./k_measn_from_scratch.py)\n\n2. **Using Built-in Library (Scikit-Learn)**\nTo simplify the clustering process, we also use the built-in KMeans algorithm from Scikit-Learn [here](./k_means_using_scikit.py)\n\n---\n\n#  Mini Project - Customer Segmenation \nIn this project, we use K-means clustering to perform customer segmentation. The dataset contains 200 rows and 5 columns representing customer data, including:\n\n* **Annual Income (in thousands)**: Customer's annual income in thousands of dollars.\n* **Spending Score (1 to 100)** :A score assigned to customers based on their spending behavior.\n* **Age** : Customer’s age.\n* **Gender** : Gender of the customer (optional for segmentation).\n* **Customer ID** :  Unique identifier for each customer.\n\n📊 **Steps Performed**:\n* Exploratory Data Analysis (EDA)\n* Visualization of clusters\n* K-means clustering implementation\n* Model Saving for prediction\n\n---\n## 🚀 Streamlit UI\nWe created a Streamlit app to provide an interactive user interface for predicting customer clusters. Users can input their annual income and spending score, and the app will display:\n\n* The predicted cluster\n* The cluster meaning (e.g., high spenders, low spenders)\n* Visualizations of the cluster distribution\n* Recommended actions based on the cluster\n\n---\n## 🛠️ Technologies Used\n* **Python**: Programming language for implementing machine learning algorithms.\n* **Scikit-Learn**: Library for machine learning models (K-means clustering).\n* **Streamlit**: Framework to create the interactive web app.\n* **Matplotlib**: Library for visualizations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadfahd%2Fcustomer_segmentation_using_kmeans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammadfahd%2Fcustomer_segmentation_using_kmeans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadfahd%2Fcustomer_segmentation_using_kmeans/lists"}