van der Maaten & Hinton (2008) t-Distributed Stochastic Neighbor Embedding - converts high dimensional Euclidean distances between datapoints into conditional probabilities that represent similarities. Aims to alleviate problem of optimizing cost function in SNE. The t-SNE cost function uses a Student t-distribution rather than a gaussian to compute the similarity between two points in the low-dimensional space

A feature of t-SNE is a tuneable parameter, “perplexity,” which says (loosely) how to balance attention between local and global aspects of your data. The parameter is, in a sense, a guess about the number of close neighbors each point has. The perplexity value has a complex effect on the resulting pictures. The original paper says, “The performance of SNE is fairly robust to changes in the perplexity, and typical values are between 5 and 50.” But the story is more nuanced than that. Getting the most from t-SNE may mean analyzing multiple plots with different perplexities. Considerations: -The perplexity really should be smaller than the number of points -the cluster sizes don’t mean anything, distances between them also might not mean anything - random noise doesn’t always look random

Top 2 features by NMI for each data type

Number of iterations <- 5000

3 Dimensions

Perplexity = 10

tsne <- Rtsne(train[,-1], dims = 3, perplexity=10, verbose=FALSE, max_iter = max_iter)

plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 20

tsne <- Rtsne(train[,-1], dims = 3, perplexity=20, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 30

tsne <- Rtsne(train[,-1], dims = 3, perplexity=30, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = unique(train$Labels), pch = 16, col = colors[train$Labels], cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 40

tsne <- Rtsne(train[,-1], dims = 3, perplexity=40, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 50

tsne <- Rtsne(train[,-1], dims = 3, perplexity=50, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Changing up dimensions

Dimsensions = 1, Perplexity = 10

tsne <- Rtsne(train[,-1], dims = 2, perplexity=10, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])

Dimsensions = 2, Perplexity = 30

tsne <- Rtsne(train[,-1], dims = 2, perplexity=30, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])

Dimsensions = 2, Perplexity = 50

tsne <- Rtsne(train[,-1], dims = 2, perplexity=50, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])


Top 15 features by NMI (cortical thickness, inattention, hyperactivity)

Number of iterations <- 20000

3 Dimensions

Perplexity = 10

tsne <- Rtsne(train[,-1], dims = 3, perplexity=10, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 20

tsne <- Rtsne(train[,-1], dims = 3, perplexity=20, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 30

tsne <- Rtsne(train[,-1], dims = 3, perplexity=30, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 40

tsne <- Rtsne(train[,-1], dims = 3, perplexity=40, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 50

tsne <- Rtsne(train[,-1], dims = 3, perplexity=50, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Changing up dimensions

Dimsensions = 1, Perplexity = 10

tsne <- Rtsne(train[,-1], dims = 2, perplexity=10, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])

Dimsensions = 2, Perplexity = 30

tsne <- Rtsne(train[,-1], dims = 2, perplexity=30, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])

Dimsensions = 2, Perplexity = 50

tsne <- Rtsne(train[,-1], dims = 2, perplexity=50, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])


All measures

Number of iterations <- 20000

3 Dimensions

Perplexity = 10

tsne <- Rtsne(train[,-1], dims = 3, perplexity=10, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = unique(train$Labels), pch = 16, col = colors[train$Labels], cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 20

tsne <- Rtsne(train[,-1], dims = 3, perplexity=20, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 30

tsne <- Rtsne(train[,-1], dims = 3, perplexity=30, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 40

tsne <- Rtsne(train[,-1], dims = 3, perplexity=40, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Perplexity = 50

tsne <- Rtsne(train[,-1], dims = 3, perplexity=50, verbose=FALSE, max_iter = max_iter)
plot3d(x=tsne$Y[,1], y=tsne$Y[,2], z=tsne$Y[,3], type = 'p', col=colors[train$Labels], size=8)
legend3d("topright", legend = names(colors), pch = 16, col = colors, cex=1, inset=c(0.02))

You must enable Javascript to view this page properly.

Changing up dimensions

Dimsensions = 1, Perplexity = 10

tsne <- Rtsne(train[,-1], dims = 2, perplexity=10, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])

Dimsensions = 2, Perplexity = 30

tsne <- Rtsne(train[,-1], dims = 2, perplexity=30, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])

Dimsensions = 2, Perplexity = 50

tsne <- Rtsne(train[,-1], dims = 2, perplexity=50, verbose=FALSE, max_iter = max_iter)
plot(tsne$Y, t='n', main="tsne")
text(tsne$Y, labels=train$Labels, col=colors[train$Labels])