Python library containing T-SNE algorithms, with significant performance improvement over the original projects from which this fork was created.
Note: Scikit-learn v0.17 includes TSNE algorithms and you should probably be using them instead of this.
A python (cython) wrapper for Barnes-Hut-SNE aka fast-tsne.
I basically took osdf's code and made it pip compliant.
- numpy > =1.7.1
- scipy >= 0.12.0
- cython >= 0.19.1
- cblas or openblas. Tested version is v0.2.5 and v0.2.6 (not necessary for OSX).
- OpenMp
You can install the package from the Github repository:
pip install git+https://github.com/rappdw/tsne.git
Or using docker (to build a wheel for linux):
$ bin/build-image jenkins
$ bin/run-image jenkins
$ (in container) python setup.py bdist_wheel
# This will generate a wheel in your project's dist directory
Or on OSX
First install gcc (for openmp support) via: brew install gcc --without-multilib
. Then
install CMake. Once that's in place you can run pip or setup.py
to build a wheel or install locally, e.g.
export PATH="/Applications/CMake.app/Contents/bin/:$PATH"; export CC=/usr/local/bin/gcc-6; export CXX=/usr/local/bin/g++-6; python setup.py bdist_wheel
export PATH="/Applications/CMake.app/Contents/bin/:$PATH"; export CXX=/usr/local/bin/g++-6; export CC=/usr/local/bin/gcc-6; pip install -e .
Basic usage:
from tsne import bh_sne
X_2d = bh_sne(X)
Or, the wheels also contain an executable that can be used from the command-line as described in the original project.
See Barnes-Hut-SNE (2013), L.J.P. van der Maaten. It is available on arxiv.
see: Python 3 - Multicore
This fork of the orignal project has a number of performance improvements resulting in an order of magnitude performance improvement when running on multi-core systems. See tsne-pref-test for performance comparisions of various branches of BH-t-SNE.