# NOT RUN {
## generate Swiss Roll data of 2,000 data points.
X <- aux.gensamples(n=2000)
## 1. Gaussian projection
output1 <- do.rndproj(X,ndim=2)
## 2. Achlioptas projection
output2 <- do.rndproj(X,ndim=2,type="achlioptas")
## 3. Sparse projection
output3 <- do.rndproj(X,type="sparse",s=5) ## fulfill condition on s
## Visualize three different projections
par(mfrow=c(1,3))
plot(output1$Y[,1],output1$Y[,2],main="Gaussian")
plot(output2$Y[,1],output2$Y[,2],main="Arclioptas")
plot(output3$Y[,1],output3$Y[,2],main="Sparse")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab