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 )
Configuration options for Isomap Number of neighbors to consider for each point in the neighborhood graph.
Number of dimensions in the embedding space.
Methods
fit
Compute the Isomap embedding from training data.
Training data of shape [nSamples, nFeatures]
Returns: The fitted Isomap instance
fitTransform ( X : Matrix ): Matrix
Fit the model and return the embedding.
Training data of shape [nSamples, nFeatures]
Returns: Embedded data of shape [nSamples, nComponents]
transform ( X : Matrix ): Matrix
Transform new data using the fitted model (out-of-sample extension).
New data to transform of shape [nSamples, nFeatures]
Returns: Embedded data of shape [nSamples, nComponents]
Properties
Embedded coordinates in low-dimensional space, shape [nSamples, nComponents]
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