Technical requirements
The following are the prerequisites of this chapter:
- Download the Excel file for this chapter here: https://github.com/PacktPublishing/Data-Forecasting-and-Segmentation-Using-Microsoft-Excel/blob/main/Chapter05/kmeansClustersChapter4_5_6_7.xlsm.
- Create and include the function in this code to calculate the optimal number of groups. Download the code from here: https://github.com/PacktPublishing/Data-Forecasting-and-Segmentation-Using-Microsoft-Excel/blob/main/Chapter05/kmeanselbow.r.
- Download the K-means function to group the data into segments from here: https://github.com/PacktPublishing/Data-Forecasting-and-Segmentation-Using-Microsoft-Excel/blob/main/Chapter05/kmeansworking01.r.
- The Kaggle data source for products, quantity, and profits to analyze the statistical groups included in the Excel file can be found at this link: https://www.kaggle.com/tanmaygangurde/global-superstore-ml/notebook.