dummy-link

TSne

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

Readme

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.clone("git://github.com/lejon/TSne.jl.git")

Basic API usage

using TSne, MNIST

function rescale(A, dim::Integer=1)
    res = A .- mean(A, dim)
    res ./= map!(x -> x > 0.0 ? x : 1.0, std(A, dim))
    res
end

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
labels = map(string, labels[1:2500])
theplot = plot(x=Y[:,1], y=Y[:,2], color=labels)
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

First Commit

11/18/2013

Last Touched

20 days ago

Commits

117 commits

Requires:

Used By: