[R] Any way to pre-set the number of observations for each cluster with kmeans?

Ranjan Maitra maitra.mbox.ignored at inbox.com
Sun Dec 29 16:57:49 CET 2013


Hello Taak,

I don't believe that this can be done. What you are asking for is
essentially a constrained k-means algorithm with the constraint that
regardless of the consequences (higher within sum or squares), you
restrict each of the K groups to have at least N observations: within
this constraint, you would like to minimize the WSS. You have to
redevelop the k-means algorithm and rewrite the appropriate code as
needed.

It appears that you may have a specific application for which you need
this particular set-up. Do you really need to use k-means for this
clustering? 

Many thanks,
Ranjan

On Sun, 29 Dec 2013 19:57:56 +0900 Takatsugu Kobayashi
<taquito2007 at gmail.com> wrote:

> Hi Rusers,
> 
> This is a simple question, but I cannot find an answer to it yet.
> I am currently running kmeans with a constraint that each cluster has at
> least an N observations. I look at Kmeans and thought "nstart" is the one,
> but it didn't work.
> 
> Could you please let me know if there are other packages that will do this?
> 
> Thank you so much.
> 
> Best,
> 
> Taak
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 


-- 
Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. Please respond to the mailing list if appropriate.
For those needing to send personal or professional e-mail, please use
appropriate addresses.

____________________________________________________________
TRY FREE IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if5
Capture screenshots, upload images, edit and send them to your friends
through IMs, post on Twitter®, Facebook®, MySpace™, LinkedIn® – FAST!



More information about the R-help mailing list