{"id":24174,"library":"opentsne","title":"openTSNE","description":"Extensible, parallel implementations of t-SNE for visualizing high-dimensional data. Supports multiple affinity models (e.g., multiscale mixture), optimization via Barnes-Hut or FIt-SNE, and out-of-sample embedding. Current version 1.0.4, requires Python >=3.9, with low release cadence (major/minor every few years).","status":"active","version":"1.0.4","language":"python","source_language":"en","source_url":"https://github.com/pavlin-policar/openTSNE","tags":["t-SNE","dimensionality reduction","visualization","manifold learning","parallel","Barnes-Hut","FIt-SNE"],"install":[{"cmd":"pip install opentsne","lang":"bash","label":"Default install"},{"cmd":"pip install opentsne[gpu]","lang":"bash","label":"With GPU support"}],"dependencies":[{"reason":"Core dependency for array operations","package":"numpy","optional":false},{"reason":"Sparse matrix and distance computations","package":"scipy","optional":false},{"reason":"Optional for spectral initialization and metrics","package":"scikit-learn","optional":true},{"reason":"Default nearest neighbor search (bundled)","package":"annoy","optional":false},{"reason":"Alternative nearest neighbor search","package":"pynndescent","optional":true},{"reason":"Optional accelerator for gradient computations (not used by default since v0.4.0)","package":"numba","optional":true}],"imports":[{"note":"Library uses camelCase 'openTSNE' as package name, not lowercase.","wrong":"from opentsne import TSNE","symbol":"TSNE","correct":"from openTSNE import TSNE"},{"note":"","wrong":null,"symbol":"TSNEEmbedding","correct":"from openTSNE import TSNEEmbedding"},{"note":"","wrong":null,"symbol":"Affinity","correct":"from openTSNE.affinity import Affinity"},{"note":"Default affinity model since v0.6.2.","wrong":null,"symbol":"MultiscaleMixture","correct":"from openTSNE.affinity import MultiscaleMixture"}],"quickstart":{"code":"from openTSNE import TSNE\nfrom sklearn.datasets import load_iris\nimport numpy as np\n\niris = load_iris()\nX = iris.data\ny = iris.target\n\n# Initialize with default parameters (multiscale perplexity = [50, 500])\ntsne = TSNE(random_state=42, verbose=False)\nembedding = tsne.fit(X)\n\nprint(embedding.shape)  # (150, 2)","lang":"python","description":"Basic t-SNE embedding using default multiscale mixture affinity."},"warnings":[{"fix":"Pass affinities via `tsne.fit(X, affinities=my_affinity)` instead of `TSNE(affinities=...)`.","message":"In openTSNE v0.6.0, the API changed: affinities are no longer passed to TSNE constructor; use `affinities` parameter in `.fit()` method instead. Also, `TSNE` no longer accepts `affinities` at construction; custom affinities must be passed to `.fit()`.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"To replicate old behavior, use `TSNE(perplexity=30, affinities='perplexity')`.","message":"The default affinity model changed from `PerplexityBasedNN` with a single perplexity to `MultiscaleMixture` with two perplexities (50 and 500) in v0.6.2. Results may differ from previous versions if not explicitly specifying perplexity.","severity":"breaking","affected_versions":">=0.6.2"},{"fix":"Use Python >=3.9 for openTSNE >=1.0.2.","message":"Python 3.6 support dropped in v1.0.1, and Python 3.9+ required starting v1.0.2. Older Python versions will fail to install.","severity":"breaking","affected_versions":">=1.0.2"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from openTSNE import TSNE` or `import openTSNE as tsne`.","cause":"Importing with wrong case; the package name is 'openTSNE' but the module is also 'openTSNE', so `import openTSNE` works, but `from openTSNE import TSNE` is needed. Common mistake: using `import opentsne` (lowercase) which is not a standard alias.","error":"AttributeError: module 'openTSNE' has no attribute 'TSNE'"},{"fix":"For openTSNE >=1.0.0: `from openTSNE import TSNEEmbedding`. For older versions (0.x): `from openTSNE.embedding import TSNEEmbedding`.","cause":"TSNEEmbedding is not directly importable from the top-level openTSNE; it resides in the `openTSNE.embedding` submodule in older versions, but in v1.x it is available from `openTSNE` directly. This error occurs when using an older version and trying the new import path.","error":"ImportError: cannot import name 'TSNEEmbedding' from 'openTSNE'"},{"fix":"Pass `perplexity=30` for single perplexity, or `perplexity=[50, 500]` for multiscale.","cause":"openTSNE v0.6.2+ expects multiscale perplexity as a list (default [50, 500]) but passing a single float or integer incorrectly can trigger this error.","error":"ValueError: The 'perplexity' parameter must be an integer or a list of integers."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}