From the course: Machine Learning with Data Reduction in Excel, R, and Power BI

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

K-means clustering in one dimension

K-means clustering in one dimension

- [Instructor] Another well-known clustering algorithm is called K-means. The K represents the number of clusters we want to leverage in the algorithm. The way this algorithm works in a high level is by changing the current cluster center based on the current mean until it finds the total of the squared distances between the data points and the closest center becomes minimized. We're going to use our average temperatures as a single dimension for performing the K-means clustering algorithm where we set K equal to two clusters. I set up an Excel exercise file KMeans as a template for our calculations. Because we're going to see how this K-means algorithm works with two clusters, we first randomly select two points in our existing clustering data sheet to use as starting points. Let's select Atlanta and San Antonio as our two random points for the initial clusters. I'll put one next to the cluster for Atlanta and…

Contents