{"id":16420208,"url":"https://github.com/geekquad/customer-segments","last_synced_at":"2026-07-10T04:30:18.853Z","repository":{"id":110635376,"uuid":"285068546","full_name":"geekquad/Customer-Segments","owner":"geekquad","description":"Analyzing a dataset containing data on various customers' annual spending amounts of diverse product categories for internal structure. Doing so would equip the distributor with insight into how to best structure their delivery service to meet the needs of each customer.","archived":false,"fork":false,"pushed_at":"2020-08-14T19:47:32.000Z","size":5159,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T05:16:47.615Z","etag":null,"topics":["customer-segmentation","customer-segmentation-analysis","gmm-clustering","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/geekquad.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":"2020-08-04T18:44:10.000Z","updated_at":"2022-09-06T06:10:43.000Z","dependencies_parsed_at":"2023-04-01T09:19:23.100Z","dependency_job_id":null,"html_url":"https://github.com/geekquad/Customer-Segments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekquad%2FCustomer-Segments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekquad%2FCustomer-Segments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekquad%2FCustomer-Segments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekquad%2FCustomer-Segments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geekquad","download_url":"https://codeload.github.com/geekquad/Customer-Segments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240511297,"owners_count":19813236,"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":["customer-segmentation","customer-segmentation-analysis","gmm-clustering","visualization"],"created_at":"2024-10-11T07:27:14.286Z","updated_at":"2026-07-10T04:30:18.805Z","avatar_url":"https://github.com/geekquad.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creating Customer Segments\nAnalyzing a dataset containing data on various customers' annual spending amounts (reported in monetary units) of diverse product categories for internal structure. One goal of this project is to best describe the variation in the different types of customers that a wholesale distributor interacts with. Doing so would equip the distributor with insight into how to best structure their delivery service to meet the needs of each customer.\n\nThe dataset for this project can be found on the \u003ca href=\"https://archive.ics.uci.edu/ml/datasets/Wholesale+customers\"\u003e UCI Machine Learning Repository.\u003c/a\u003e For the purposes of this project, the features 'Channel' and 'Region' will be excluded in the analysis — with focus instead on the six product categories recorded for customers.\n\n\u003chr\u003e \u003c/hr\u003e\n\n## Data Exploration:\nThe dataset is composed of six important product categories: \n\n- 'Fresh' \n- 'Milk' \n- 'Grocery' \n- 'Frozen' \n- 'Detergents_Paper'\n- 'Delicatessen'\n\n### Percentile for Each Sample:\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/each_Sample_percentage.png\"\u003e\n\n#### Customer Index : 25 (Index 0)\n- Major Spending: Fresh, DetergentS_Paper (Based on \"HeatMap\" \u0026 \"\u003e mean_value\")\n- Medium Spending: Milk, Grocery (Based on \"HeatMap\" \u0026 \"Around mean_value\")\n- Minor Spending: Frozen, Delicatessen (Based on \"HeatMap\" \u0026 \"\u003c mean_value\")\n    - **Conclusion: Small Retail Store.**\n\n#### Customer Index : 50 (Index 1)\n- Major Spending: Frozen, Delicatessen (Based on \"HeatMap\" \u0026 \"\u003e mean_value\")\n- Medium Spending: Fresh, Detergents_Paper (Based on \"HeatMap\" \u0026 \"Around mean_value\")\n- Minor Spending: Milk, Grocery (Based on \"HeatMap\" \u0026 \"\u003c mean_value\")\n    - **Conclusion: Restaurant**\n\n#### Customer Index : 75 (Index 2)\n- Major Spending: Frozen, Fresh (Based on \"HeatMap\" \u0026 \"\u003e mean_value\")\n- Medium Spending: Delicatessen (Based on \"HeatMap\" \u0026 \"Around mean_value\")\n- Minor Spending: Milk, Grocery, Detergents_Paper (Based on \"HeatMap\" \u0026 \"\u003c mean_value\")\n    - **Conclusion: Supplier (with Small Resturent Business) / Supermarket (with attached Small Restaurant)**\n    \n### Feature Distribution\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/feature%20distribution.png\"\u003e\n\n\u003chr\u003e \u003c/hr\u003e\n\n## Data Preprocessing\n\n### Feature Scaling:\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/feature%20scaling.png\"\u003e\n\nDistribution before Normalizing the Data:\n\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/before%20normalizing.png\"\u003e\n\nDistribution after Normalizing the Data:\n\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/after%20normalilzing.png\"\u003e\n\n\u003chr\u003e \u003c/hr\u003e\n\n## Feature transformation\n\n### PCA Implementation:\n\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/pca%20implementation.png\"\u003e\n\n### Dimension Reductinality:\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/dimension%20reductionality.png\"\u003e\n\n### Visulaizing Biplot:\nA biplot is a scatterplot where each data point is represented by its scores along the principal components. The axes are the principal components (in this case Dimension 1 and Dimension 2). In addition, the biplot shows the projection of the original features along the components. A biplot can help us interpret the reduced dimensions of the data, and discover relationships between the principal components and original features.\n\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/biplot.png\"\u003e\n\n\u003chr\u003e \u003c/hr\u003e\n\n## Clustering:\nChoosing Gaussian Mixture Model algorithm because of its ability to apply \"soft\" classification and since we've reduced the dimensionality of the problem with PCA, GMM should be able to do the job.\n\n### GMM Clustering Visualization:\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/gmm%20cluster.png\"\u003e\n\n\u003chr\u003e \u003c/hr\u003e\n\n## Visualizing Underlying Distributions\n\n\u003cimg src=\"https://github.com/geekquad/Customer-Segments/blob/master/img/underlying%20distributions.png\"\u003e\n\n#### Final Conclusion:\n- The actual data appears to correlate very strongly with our predicted clusters earlier. It shows that the GMM clustering was able to establish the key relationships very well. It wasn't able to capture some of the more anamolous data points - particularly Retailers lying within the Hotel/Restaurant/Cafe cluster.\n\n- The actual distribution has a less well defined seperation between clusters, but it can be stated with reasonable confidence.\n\n- Yes, they are almost exactly the guesses I made regarding their classification - Cluster 0 I thought to be Restaurants/Cafes (I didn't consider hotels) and Cluster 1 being Bulk Distributor or Supermarkets, which is analagous to retailers.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekquad%2Fcustomer-segments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeekquad%2Fcustomer-segments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekquad%2Fcustomer-segments/lists"}