Code Monkey home page Code Monkey logo

textsne's Introduction

textSNE
=======

Python code for rendering t-SNE code with text labels for each point.

See test-output.expected.png for an example of the sort of visualization
this code will perform.

t-SNE is:
    van der Maaten, L. J. P. and Hinton, G. E. (2008)
    Visualizing Data using t-SNE.
    Journal of Machine Learning Research, Vol 9, (Nov) pp 2579-2605.

Where noted in header code or by directory name, I have included 3rd-party code.

My main change from the original t-SNE implementation is that I
disable PCA as a preprocessing step, unless specifically explicitly by
a function parameter. Since my data is high-dimensional and sparse,
PCA is painfully slow.

To get started:

1) Unpack the original tSNE package:
    cd 3rd-party/t-SNE_files/
    tar zxvf tSNE_linux.tar.gz 
If you are on a different architecture, you will have to unzip another package.

Alternately, you can use the pure Python implementation of t-SNE by
replacing all code that reads:
    from calc_tsne import tsne
with the following code:
    from tsne import tsne
You will need matplotlib to run the pure Python implementation. However, 

2) (Optional) Edit render.py and change DEFAULT_FONT to a TTF file
containing a font you like.

3) Run ./test.py to test your installation.
This will generate file 'test-output.rendered.png'.
Note that 'test-output.rendered.png' and 'test-output.expected.png'
are different, because each invockation of tSNE_linux uses a different
random initialization.

=======

REQUIREMENTS:
    imagemagick:
        We use convert at the end of render.render, to flatten an image.
        Type:
            which convert
        as a test to see if you have this executable.
        You could perhaps remove this image flattening step, if you like.

textsne's People

Contributors

turian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.