Julia implementation of L.J.P. van der Maaten and G.E. Hintons t-SNE visualisation technique.
The scripts in the examples
folder require Gadfly
, MNIST
and RDatasets
Julia packages.
julia> Pkg.add("TSne")
using TSne, MNIST
rescale(A, dim::Integer=1) = (A .- mean(A, dim)) ./ max.(std(A, dim), eps())
data, labels = traindata()
data = convert(Matrix{Float64}, data[:, 1:2500])'
# Normalize the data, this should be done if there are large scale differences in the dataset
X = rescale(data, 1)
Y = tsne(X, 2, 50, 1000, 20.0)
using Gadfly
theplot = plot(x=Y[:,1], y=Y[:,2], color=string.(labels[1:size(Y,1)]))
draw(PDF("myplot.pdf", 4inch, 3inch), theplot)
julia demo-csv.jl haveheader --labelcol=5 iris-headers.csv
Creates myplot.pdf
with t-SNE result visualized using Gadfly.jl
.