Description Usage Arguments Author(s) Examples
this implements the protocol in Ng Jordan 2001 NIPS for 2 clusters. weights are calculated for a range of gamma values. Kmeans is fit to the top 2 eigenvectors in each case, and we pick the eigenvectors the best reconstruction error
1 | get.best.eigenvectors(S, K, evec.transform)
|
S |
|
K |
|
evec.transform |
Toby Dylan Hocking
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(1)
sim <- gendata(N=20,D=2,K=2,SD=0.1)
pts <- data.frame(sim$mat,class=sim$class)
xyplot(X1~X2,pts,groups=class,aspect="iso")+
layer_(ltext(x,y,1:length(x)))
best <- get.best.eigenvectors(sim$mat,2,e.usual.k(2))
vecs <- data.frame(as.matrix(best),class=sim$class)
xyplot(X1~X2,vecs,groups=class,aspect="iso")
best <- get.best.eigenvectors(sim$mat,2,e.exponential)
vecs <- data.frame(as.matrix(best),class=sim$class)
xyplot(X1~X2,vecs,groups=class,aspect="iso")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.