Class TSNE

A class for performing dimensionality reduction on a matrix of data.

Hierarchy

Constructors

  • t-SNE algorithm for dimensionality reduction.

    Parameters

    • data: Matrix | number[][]

      A 2D array or matrix whose dimensionality is to be reduced.

    • Optional params: Partial<TSNEParams>

      Optional parameters for the algorithm.

    Returns TSNE

Properties

_data: Matrix
_gains: Matrix
_initialized: boolean = false
_iter: number = 0
_projection: Matrix
_randomizer: Randomizer
_result: Matrix
_yStep: Matrix

Accessors

  • get dimensionality(): number
  • Gets the dimensionality of the data after dimensionality reduction.

    Returns number

  • get metric(): string
  • Gets the metric used for calculating distances between data points.

    Returns string

  • get parameters(): Omit<P & DimRedParams, "dimensionality" | "metric" | "seed">
  • Gets the parameters used for the algorithm.

    Returns Omit<P & DimRedParams, "dimensionality" | "metric" | "seed">

  • get seed(): number
  • Gets the seed used for generating random numbers.

    Returns number

Methods

  • A generator function that yields the projection of the data after each iteration.

    Parameters

    • iterations: number = 500

      The number of iterations to perform. Default to 500.

    Returns Generator<Matrix, Matrix, unknown>

    The projection of the data after dimensionality reduction.

    Yields

    The projection of the data after each iteration.

  • Initializes the t-SNE algorithm by computing pairwise distances between data points and computing probabilities for each pair of points. It also initializes the step and gains matrices.

    Returns TSNE

    The t-SNE instance.

  • Transforms the data by performing dimensionality reduction on it.

    Parameters

    • iterations: number = 500

      The number of iterations to perform. Default to 500.

    Returns Matrix

    The projection of the data after dimensionality reduction.