I currently face an unsupervised learning task that is to be approaches using clustering. More specifically, it is a segementation task and hence there is some prior knowledge about a) the number of clusters and b) the rough content of each segment. From literature this seems like a prime example, where "constrained k-means" would come into play and I'm really eager to try it out. Both of the above mentionend pieces of prior knowledge can be incorporated in "constrained k-means" as a) is represented by k and b) can be expressed in "must-link constraints". (For a good overview over constrained k-means see Wagstaff, Cardie, Rogers, Schrödl, & others (2001).)
My problem now is that I can't find a suitable implementation in R on CRAN. Programming it myself in R would be ok, based on the pseudocode, but my programming is most certainly not efficient enough, since we are talking about a somewhat large dataset (75.000 x 30).
So, I turn to this community hoping that someone has found an efficient implementation of "constrained k-means" in R or is willing to provide code that is somewhat efficient.
Thank you very much,
Update 23.06.2016: Thanks for your replies so far. In order to make the problem a little more succint please see a sample data file here. (Note: this is not an excerpt of my original data as it is highly sensitive, but an artificial dataset with the same characteristics (less rows though))
Two examples of simple constraints:
- all observations that have either a 1 in v305 or a 1 in v306 must be linked (must-link-constraint)
- all observations that have a 1 in v258 and v262 must be linked (must-link-constraint)
Currently looking at your suggestions, Rahul. Thanks very much.