0
$\begingroup$

I am reading about k-means clustering method.

How does the method calculate the mean between two coordination points? How does the method work with more than two dimensions? How can calculate the distance and the mean if there are more than two dimension?

Are there any packages about k-means clustering in R?

$\endgroup$
  • $\begingroup$ kmeans() is built into R, the function "gets loaded" with the set of libraries R always loads at startup, so you don't have to import or install anything. $\endgroup$ – knb Jul 31 '17 at 8:08
2
$\begingroup$

To answer simply, Euclidean distance is generally used:

$$ d = |\mathbf{x}-\mathbf{y}|=\sqrt{\sum_{i=1}^n|x_i-y_i|^2}$$

Read more about k-means over here:

Using kmeans() in R:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.