mlampros / ClusterR

Gaussian mixture models, k-means, mini-batch-kmeans and k-medoids clustering
https://mlampros.github.io/ClusterR/
84 stars 29 forks source link

How to change the distance in k-means clustering #13

Closed yaqiangzheng closed 5 years ago

yaqiangzheng commented 5 years ago

Hello I am a beginner for R. I want to do kmeans clustering in ClusterR packages, I want try other distance. but I can not find arguments about distance. How to change the distance in n ClusterR packages? I'm happy to hear how to do it! Best, Zheng yaqiang

mlampros commented 5 years ago

@yaqiangzheng I'm sorry for the late reply,

the kmeans algorithm (KMeans_arma, KMeans_rcpp, MiniBatchKmeans) uses by default a single distance to cluster data points. In my implementation I use the WSSE (Within Sum of Squared Error) for this purpose. You might find this question that I found on the web informative. In case that you want to use another distance function, then the Cluster_Medoids (small to medium datasets) and Clara_Medoids (for big data sets) allow you to use various distance metrics.

yaqiangzheng commented 5 years ago

Thanks for the in depth reply. I will try and follow the tutorial in the link.

stale[bot] commented 5 years ago

This is Robo-lampros because the Human-lampros is lazy. This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs. Feel free to re-open a closed issue and the Human-lampros will respond.