New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@keckelt/tsne

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keckelt/tsne

Updated t-SNE implementation in TypeScript.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

tSNE

Updated implementation of tSNEJS in TypeScript. Published it on NPM: npm install @keckelt/tsne.

Usage

import {TSNE} from '@keckelt/tsne-js';

const data = [...];

// TODO one hot encoding, normalization, ...

const opt = {
  epsilon: 10, // epsilon is learning rate (10 = default)
  perplexity: data.length ** 0.5, // roughly how many neighbors each point influences (30 = default)
  dim: 2 // dimensionality of the embedding (2 = default)
};

const tsne = new TSNE(opt);
tsne.initDataRaw(data);

const iterations = 500;
for(let i = 0; i < iterations; i++) {
  tsne.step(); // every time you call this, solution gets better
}

var Y = tsne.getSolution(); // Y is an array of 2-D points that you can plot

Worker

You can use Comlink, for example, to wrap the TSNE class and have the code executed in a worker thread:

import * as Comlink from 'comlink';
import { TSNE } from '@keckelt/tsne-js';

Comlink.expose(TSNE);

FAQs

Package last updated on 20 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc