Hi Friedrich,

Thanks for the response!

I have tried the following:
---------------------------------------------------------
nums <- sample(1:300,70)
x <- matrix(nums,10,7)
mygroups <- c(1,3,4)   # i.e. I would like these 3 rows in 'x' to cluster together

myfam <- kccaFamily("kmeans", groupFun = "minSumClusters")
clres <- kcca(x, k=3, myfam, group=mygroups)

--------------------------------------------------------

I get the following result:

> clres
kcca object of family 'kmeans' 

call:
kcca(x = x, k = 3, family = myfam, group = mygroups)

cluster sizes:

1 2 
3 7 


I have two questions:

i) How do I get the details of the clusters (i.e which points/rows are in which cluster)?

ii) If k=3, then shouldn't there be 3 clusters?

 
thanks again!




friedrich.leisch@stat.uni-muenchen.de wrote: >>>>> On Thu, 25 Oct 2007 09:12:32 -0700 (PDT),
>>>>> Tim Smith (TS) wrote:

  > Hi,
  > Is there any package that implements semi-supervised clustering
  > through 'must-link' and 'cannot-link' constraints?

Package flexclust on CRAN can do constrained clustering. The feature
is not well documented in the current release version, but

  myfam <- kccaFamily("kmeans", groupFun = "minSumClusters")
  clres <- kcca(x, k, myfam, group=mygroups)

will assign all points which belong to one group to the same
cluster using kmeans (but flexclust can use other distances than
Euclidean, too).

  groupFun = "minSumClusters" will assign to the cluster where the
             center has minimal average distance to all group members.

  groupFun = "majorityClusters" assigns the all group members to the
             cluster the majority belongs to.

  groupFun = "differentClusters" implements a 'cannot-link'
             constraint, obviously the group sizes must be smaller
             than the number of clusters in this case.

Some details on the algorithms used can be found in

 http://www.ci.tuwien.ac.at/papers/Leisch+Gruen-2006.pdf

Hope this helps,
Fritz


 __________________________________________________



	[[alternative HTML version deleted]]

