## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

# Measuring distance between clusters

K-means clustering uses Euclidian distances to determine how far apart each of the clusters are from each other. For clusters of just one variable, the computation is trivial. You just take the centroids from any two clusters and subtract them from one another. As you add more variables, the computation becomes slightly more involved since you will be summing the squared difference between all of the variables that comprise each of the clusters, and summing them all together to determine the total distance.

Here is an example of how the centroid is determined for three cluster members that have been assigned to cluster 1. Centroid 1 has been calculated, the vector [186,45] where 186 is the average of the ...

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required