# NOT RUN {
## load iris data
data(iris)
X = as.matrix(iris[,1:4])
label = as.factor(iris$Species)
## compare different perplexity
out1 <- do.tsne(X, ndim=2, perplexity=5)
out2 <- do.tsne(X, ndim=2, perplexity=10)
out3 <- do.tsne(X, ndim=2, perplexity=25)
## Visualize three different projections
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(out1$Y, col=label, main="tSNE::perplexity=5")
plot(out2$Y, col=label, main="tSNE::perplexity=10")
plot(out3$Y, col=label, main="tSNE::perplexity=25")
par(opar)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab