Skip to content

Instantly share code, notes, and snippets.

@nqbao
Created June 25, 2016 16:08
Show Gist options
  • Save nqbao/36551326b959127e536937751c3fe8aa to your computer and use it in GitHub Desktop.
Save nqbao/36551326b959127e536937751c3fe8aa to your computer and use it in GitHub Desktop.
# Visualize iris data using T-SNE
library(ggplot2)
library(tsne)
r = tsne(iris[, 2:4])
r2 = as.data.frame(r)
names(r2) = c('x', 'y')
r2 = cbind(r2, class=iris$Species)
ggplot(r2) + geom_point(aes(x, y, color=class))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment