This project was created to show how the K-means clustering algorithm is implemented.
K (the given number of cluster centers) random data points are selected in the dataset. Every data point in the dataset is then 'assigned' or labeled to the nearest cluster center based on euclidean distance, and the cluster centers are re-computed by taking the average of all the points within the class. The optimal number for K is often selected by choosing the 'kink in the curve', in this case of a Mean Squared Error (MSE) loss function.
The input data was pulled from the UCI Machine Learning Repository.
Given the MSE graph, the kink in the curve appears to be around 6 clusters for this dataset.