Skip to main content

Overview

Isomap (Isometric Mapping) performs non-linear dimensionality reduction by preserving geodesic distances between points. It builds a neighborhood graph and uses graph distances to approximate manifold structure.

Constructor

new Isomap(options?: IsomapOptions)
options
IsomapOptions
Configuration options for Isomap

Methods

fit

fit(X: Matrix): this
Compute the Isomap embedding from training data.
X
Matrix
required
Training data of shape [nSamples, nFeatures]
Returns: The fitted Isomap instance

fitTransform

fitTransform(X: Matrix): Matrix
Fit the model and return the embedding.
X
Matrix
required
Training data of shape [nSamples, nFeatures]
Returns: Embedded data of shape [nSamples, nComponents]

transform

transform(X: Matrix): Matrix
Transform new data using the fitted model (out-of-sample extension).
X
Matrix
required
New data to transform of shape [nSamples, nFeatures]
Returns: Embedded data of shape [nSamples, nComponents]

Properties

embedding_
Matrix | null
Embedded coordinates in low-dimensional space, shape [nSamples, nComponents]
nFeaturesIn_
number | null
Number of features seen during fit

Example

import { Isomap } from '@elucidate/elucidate';

// Swiss roll or other manifold data
const data = [
  [1.0, 2.0, 1.5],
  [1.1, 2.1, 1.6],
  [2.0, 3.0, 2.5],
  [2.1, 3.1, 2.6],
  [3.0, 4.0, 3.5],
  [3.1, 4.1, 3.6],
];

const isomap = new Isomap({ 
  nNeighbors: 3,
  nComponents: 2 
});

const embedding = isomap.fitTransform(data);
console.log('Embedded coordinates:', embedding);

// Transform new points
const newData = [
  [1.5, 2.5, 2.0],
  [2.5, 3.5, 3.0],
];

const newEmbedding = isomap.transform(newData);
console.log('New points embedded:', newEmbedding);

Notes

  • Isomap assumes data lies on a smooth, low-dimensional manifold
  • Works best when the neighborhood graph is connected
  • The algorithm uses Floyd-Warshall to compute geodesic distances
  • Out-of-sample extension uses weighted averaging of nearest training points

Build docs developers (and LLMs) love