Re: [R] distance in kmeans algorithm?

2006-07-10 Thread Timo Becker
> >Hello. > >Is it possible to choose the distance in the kmeans algorithm? > >I have m vectors of n components and I want to cluster them using kmeans >algorithm but I want to use the Mahalanobis distance or another distance. > >How can I do it in R? >If I use kmeans, I have no option to choose t

Re: [R] distance in kmeans algorithm?

2006-07-09 Thread Prof Brian Ripley
You do realize that Mahalanobis distance is just Euclidean distance on some linear transformation of the variables? So all you need to do is to transform the data you pass to kmeans to 'sphere' the Mahalanobis distance. The K means *algorithms* do depend on Euclidean distance (e.g. in choosing

[R] distance in kmeans algorithm?

2006-07-09 Thread Arnau Mir
Hello. Is it possible to choose the distance in the kmeans algorithm? I have m vectors of n components and I want to cluster them using kmeans algorithm but I want to use the Mahalanobis distance or another distance. How can I do it in R? If I use kmeans, I have no option to choose the distance.