@thi.ng/tsne
Version:
Highly configurable t-SNE implementation for arbitrary dimensions
119 lines (81 loc) • 4.12 kB
Markdown
<!-- This file is generated - DO NOT EDIT! -->
<!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
# 
[](https://www.npmjs.com/package/@thi.ng/tsne)

[](https://mastodon.thi.ng/@toxi)
> [!NOTE]
> This is one of 210 standalone projects, maintained as part
> of the [.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
> and anti-framework.
>
> 🚀 Please help me to work full-time on these projects by [sponsoring me on
> GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
- [About](#about)
- [Status](#status)
- [Installation](#installation)
- [Dependencies](#dependencies)
- [Usage examples](#usage-examples)
- [API](#api)
- [Authors](#authors)
- [License](#license)
## About
Highly configurable t-SNE implementation for arbitrary dimensions.
Current implementation (as of 07/2021) is based in principle on:
- https://github.com/karpathy/tsnejs
Most key functionality has been refactored/rewritten to use pre-existing
functionality provided by other thi.ng packages.
~~Furthermore, this implementation has been extended to use
https://thi.ng/geom-accel to optimize spatial lookups~~. (FIXME currently
disabled/removed again)
## Status
**ALPHA** - bleeding edge / work-in-progress
[Search or submit any issues for this package](https://github.com/thi-ng/umbrella/issues?q=%5Btsne%5D+in%3Atitle)
## Installation
```bash
yarn add .ng/tsne
```
ESM import:
```ts
import * as tsne from "@thi.ng/tsne";
```
Browser ESM import:
```html
<script type="module" src="https://esm.run/@thi.ng/tsne"></script>
```
[JSDelivr documentation](https://www.jsdelivr.com/)
For Node.js REPL:
```js
const tsne = await import("@thi.ng/tsne");
```
Package sizes (brotli'd, pre-treeshake): ESM: 1.51 KB
## Dependencies
- [.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
- [.ng/math](https://github.com/thi-ng/umbrella/tree/develop/packages/math)
- [.ng/random](https://github.com/thi-ng/umbrella/tree/develop/packages/random)
- [.ng/transducers](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers)
- [.ng/vectors](https://github.com/thi-ng/umbrella/tree/develop/packages/vectors)
Note: .ng/api is in _most_ cases a type-only import (not used at runtime)
## Usage examples
One project in this repo's
[/examples](https://github.com/thi-ng/umbrella/tree/develop/examples)
directory is using this package:
| Screenshot | Description | Live demo | Source |
|:--------------------------------------------------------------------------------------------------------------------|:----------------------------------------|:--------------------------------------------------|:-------------------------------------------------------------------------------|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/tsne-colors.avif" width="240"/> | Animated t-SNE visualization of 4D data | [Demo](https://demo.thi.ng/umbrella/tsne-colors/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/tsne-colors) |
## API
[Generated API docs](https://docs.thi.ng/umbrella/tsne/)
TODO
## Authors
- [Karsten Schmidt](https://thi.ng)
If this project contributes to an academic publication, please cite it as:
```bibtex
{thing-tsne,
title = "@thi.ng/tsne",
author = "Karsten Schmidt",
note = "https://thi.ng/tsne",
year = 2021
}
```
## License
© 2021 - 2025 Karsten Schmidt // Apache License 2.0