ngphuoc / TSne.jl

Julia port of L.J.P. van der Maaten and G.E. Hintons T-SNE visualisation technique.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Travis Coveralls

t-SNE (t-Stochastic Neighbor Embedding)

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.

Installation

julia> Pkg.add("TSne")

Basic API usage

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)

Command line usage

julia demo-csv.jl haveheader --labelcol=5 iris-headers.csv

Creates myplot.pdf with t-SNE result visualized using Gadfly.jl.

See also

About

Julia port of L.J.P. van der Maaten and G.E. Hintons T-SNE visualisation technique.

License:Other


Languages

Language:Julia 100.0%