[R] Using centers of hierarchical clustering for k-means

Sarah Goslee sarah.goslee at gmail.com
Fri May 16 19:09:18 CEST 2014


Well, you could use the group membership from the clustering along
with, for instance, aggregate() to get the mean values for each
cluster, and pass those to kmeans() using the centers argument as
described in the help file.

Unless you want medoids instead of centroids, since you didn't specify?

If you post a reproducible example including the code for the parts
you know how to do, you might get someone willing to fill in the code
for the unknown parts.

Sarah

On Fri, May 16, 2014 at 8:29 AM, marioger <mario_wiegand at gmx.de> wrote:
> Hi,
>
> i have the following problem: I am using k-means algorithm for clustering.
> But instead of using randomized centers, I would like to use centers created
> by hierarchical clustering. So I want to apply "hclust" on my data set (in
> this case the iris data), getting a solution by "cutree", calculating the
> means/centers of the resulting clusters and use these centers as starting
> points for k-means clusterng. But I have no idea how I calculate the centers
> of the clusters and how to use them as starting points for the k-means
> algorithm.
>
> Hope you can help. Thanks in advance.
>
> Mario
>
>
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list