if (FALSE) {
## use a small subset of iris data
set.seed(100)
id = sample(1:150, 50)
X = as.matrix(iris[id,1:4])
lab = as.factor(iris[id,5])
## try different connectivity levels
output1 <- do.mve(X, knn=5)
output2 <- do.mve(X, knn=10)
output3 <- do.mve(X, knn=20)
## Visualize two comparisons
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(output1$Y, main="knn:k=5", pch=19, col=lab)
plot(output2$Y, main="knn:k=10", pch=19, col=lab)
plot(output3$Y, main="knn:k=20", pch=19, col=lab)
par(opar)
}
Run the code above in your browser using DataLab