openTSNE

Extensible, parallel implementations of t-SNE

Github星跟踪图

openTSNE
========, Build Status, ReadTheDocs Badge, Codacy Badge, License Badge, openTSNE is a modular Python implementation of t-Distributed Stochasitc Neighbor Embedding (t-SNE) [1], a popular dimensionality-reduction algorithm for visualizing high-dimensional data sets. openTSNE incorporates the latest improvements to the t-SNE algorithm, including the ability to add new data points to existing embeddings [2], massive speed improvements [3]_ [4], enabling t-SNE to scale to millions of data points and various tricks to improve global alignment of the resulting visualizations [5].

.. figure:: docs/source/images/macosko_2015.png
:alt: Macosko 2015 mouse retina t-SNE embedding
:align: center

A visualization of 44,808 single cell transcriptomes obtained from the mouse retina [6]_ embedded using the multiscale kernel trick to better preserve the global aligment of the clusters.

  • Documentation <http://opentsne.readthedocs.io>__
  • User Guide and Tutorial <https://opentsne.readthedocs.io/en/latest/tsne_algorithm.html>__
  • Examples: basic <https://opentsne.readthedocs.io/en/latest/examples/01_simple_usage/01_simple_usage.html>, advanced <https://opentsne.readthedocs.io/en/latest/examples/02_advanced_usage/02_advanced_usage.html>, preserving global alignment <https://opentsne.readthedocs.io/en/latest/examples/03_preserving_global_structure/03_preserving_global_structure.html>, embedding large data sets <https://opentsne.readthedocs.io/en/latest/examples/04_large_data_sets/04_large_data_sets.html>
  • Speed benchmarks <https://opentsne.readthedocs.io/en/latest/benchmarks.html>__

Installation

openTSNE requires Python 3.6 or higher in order to run.

Conda


openTSNE can be easily installed from ``conda-forge`` with

::

   conda install --channel conda-forge opentsne

`Conda package <https://anaconda.org/conda-forge/opentsne>`__

PyPi
~~~~

openTSNE is also available through ``pip`` and can be installed with

::

   pip install opentsne

`PyPi package <https://pypi.org/project/openTSNE>`__

Note that openTSNE requires a C/C++ compiler. ``numpy`` must also be
installed.

In order for openTSNE to utilize multiple threads, the C/C++ compiler
must also implement ``OpenMP``. In practice, almost all compilers
implement this with the exception of older version of ``clang`` on OSX
systems.

To squeeze the most out of openTSNE, you may also consider installing
FFTW3 prior to installation. FFTW3 implements the Fast Fourier
Transform, which is heavily used in openTSNE. If FFTW3 is not available,
openTSNE will use numpy’s implementation of the FFT, which is slightly
slower than FFTW. The difference is only noticeable with large data sets
containing millions of data points.

A hello world example
---------------------

Getting started with openTSNE is very simple. First, we'll load up some data using scikit-learn

.. code:: python

   from sklearn import datasets

   iris = datasets.load_iris()
   x, y = iris["data"], iris["target"]

then, we'll import and run

.. code:: python

   from openTSNE import TSNE

   embedding = TSNE().fit(x)

Citation
--------

If you make use of openTSNE for your work we would appreciate it if you would cite the paper

.. code::

    @article {Poli{\v c}ar731877,
        author = {Poli{\v c}ar, Pavlin G. and Stra{\v z}ar, Martin and Zupan, Bla{\v z}},
        title = {openTSNE: a modular Python library for t-SNE dimensionality reduction and embedding},
        year = {2019},
        doi = {10.1101/731877},
        publisher = {Cold Spring Harbor Laboratory},
        URL = {https://www.biorxiv.org/content/early/2019/08/13/731877},
        eprint = {https://www.biorxiv.org/content/early/2019/08/13/731877.full.pdf},
        journal = {bioRxiv}
    }
    
openTSNE implements two efficient algorithms for t-SNE. Please consider citing the original authors of the algorithm that you use. If you use FIt-SNE (default), then the citation is [4]_ below, but if you use Barnes-Hut the citation is [3]_. 


References
----------

.. [1] Van Der Maaten, Laurens, and Hinton, Geoffrey. `“Visualizing data using
    t-SNE.” <http://www.jmlr.org/papers/volume9/vandermaaten08a/vandermaaten08a.pdf>`__
    Journal of Machine Learning Research 9.Nov (2008): 2579-2605.
.. [2] Poličar, Pavlin G., Martin Stražar, and Blaž Zupan. `“Embedding to Reference t-SNE Space Addresses Batch Effects in Single-Cell Classification.” <https://www.biorxiv.org/content/10.1101/671404v1.abstract>`__ BioRxiv (2019): 671404.
.. [3] Van Der Maaten, Laurens. `“Accelerating t-SNE using tree-based algorithms.”
    <http://www.jmlr.org/papers/volume15/vandermaaten14a/vandermaaten14a.pdf>`__
    Journal of Machine Learning Research 15.1 (2014): 3221-3245.
.. [4] Linderman, George C., et al. `"Fast interpolation-based t-SNE for improved
    visualization of single-cell RNA-seq data." <https://www.nature.com/articles/s41592-018-0308-4>`__ Nature Methods 16.3 (2019): 243.
.. [5] Kobak, Dmitry, and Berens, Philipp. `“The art of using t-SNE for single-cell transcriptomics.” <https://www.nature.com/articles/s41467-019-13056-x>`__
    Nature Communications 10, 5416 (2019).
.. [6] Macosko, Evan Z., et al. \ `“Highly parallel genome-wide expression profiling of
    individual cells using nanoliter droplets.”
    <https://www.sciencedirect.com/science/article/pii/S0092867415005498>`__
    Cell 161.5 (2015): 1202-1214.

.., Build Status, image:: https://dev.azure.com/pavlingp/openTSNE/_apis/build/status/Test?branchName=master
   :target: https://dev.azure.com/pavlingp/openTSNE/_build/latest?definitionId=1&branchName=master
.., ReadTheDocs Badge, image:: https://readthedocs.org/projects/opentsne/badge/?version=latest
   :target: https://opentsne.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status
.., Codacy Badge, image:: https://api.codacy.com/project/badge/Grade/ef67c21a74924b548acae5a514bc443d
   :target: https://app.codacy.com/app/pavlin-policar/openTSNE?utm_source=github.com&utm_medium=referral&utm_content=pavlin-policar/openTSNE&utm_campaign=Badge_Grade_Dashboard
.., License Badge, image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
   :target: https://opensource.org/licenses/BSD-3-Clause

主要指标

概览
名称与所有者pavlin-policar/openTSNE
主编程语言Python
编程语言Python (语言数: 6)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2018-06-08 18:42:09
推送于2025-05-27 20:53:52
最后一次提交2025-05-27 21:45:59
发布数22
最新版本名称v1.0.3 (发布于 )
第一版名称v0.2.0 (发布于 )
用户参与
星数1.5k
关注者数21
派生数173
提交数697
已启用问题?
问题数142
打开的问题数11
拉请求数121
打开的拉请求数2
关闭的拉请求数6
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?