Running the K-means function to get the centroids or group average
Now, we'll pass a parameter for the number of groups we want to process with K-means. This is a parameter in cell C1:1
for the function. Also, we include the range of input values and the range where the function will insert the group assignment values.
To execute the K-means function, take the following steps (and also see Figure 5.6):
- Insert the number of groups to apply segmentation.
- Define the Excel sheet data input range.
- Specify the Excel sheet range to store the group segmentation results.
With the results, we will do a pivot analysis to understand the group assignment to every value of the data input.
Figure 5.6 shows how we specify the parameters of the K-means function. We can explain this process step by step as follows:
- Insert the number of groups to apply segmentation.
The first parameter...