Table of Contents

Class Isomap<T>

Namespace
AiDotNet.Preprocessing.DimensionalityReduction
Assembly
AiDotNet.dll

Isomap (Isometric Mapping) for nonlinear dimensionality reduction.

public class Isomap<T> : TransformerBase<T, Matrix<T>, Matrix<T>>, IDataTransformer<T, Matrix<T>, Matrix<T>>

Type Parameters

T

The numeric type for calculations (e.g., float, double).

Inheritance
TransformerBase<T, Matrix<T>, Matrix<T>>
Isomap<T>
Implements
IDataTransformer<T, Matrix<T>, Matrix<T>>
Inherited Members

Remarks

Isomap extends classical MDS by estimating geodesic distances along the data manifold instead of using Euclidean distances. It builds a neighborhood graph and computes shortest paths to estimate geodesic distances.

The algorithm: 1. Build a k-nearest neighbors graph 2. Compute shortest path distances (Floyd-Warshall or Dijkstra) 3. Apply MDS to the geodesic distance matrix

For Beginners: Isomap "unrolls" curved data: - Imagine data lying on a Swiss roll (curved surface) - Regular PCA can't flatten it properly - Isomap finds distances along the surface, not through the air - Result: Points that are nearby on the surface stay nearby

Constructors

Isomap(int, int, IsomapNeighborAlgorithm, IsomapPathAlgorithm, int[]?)

Creates a new instance of Isomap<T>.

public Isomap(int nComponents = 2, int nNeighbors = 5, IsomapNeighborAlgorithm neighborAlgorithm = IsomapNeighborAlgorithm.Auto, IsomapPathAlgorithm pathAlgorithm = IsomapPathAlgorithm.Dijkstra, int[]? columnIndices = null)

Parameters

nComponents int

Target dimensionality. Defaults to 2.

nNeighbors int

Number of neighbors for graph construction. Defaults to 5.

neighborAlgorithm IsomapNeighborAlgorithm

Algorithm for neighbor search. Defaults to Auto.

pathAlgorithm IsomapPathAlgorithm

Algorithm for shortest paths. Defaults to Dijkstra.

columnIndices int[]

The column indices to use, or null for all columns.

Properties

Embedding

Gets the embedding result.

public double[,]? Embedding { get; }

Property Value

double[,]

GeodesicDistances

Gets the geodesic distance matrix.

public double[,]? GeodesicDistances { get; }

Property Value

double[,]

NComponents

Gets the number of components.

public int NComponents { get; }

Property Value

int

NNeighbors

Gets the number of neighbors for graph construction.

public int NNeighbors { get; }

Property Value

int

SupportsInverseTransform

Gets whether this transformer supports inverse transformation.

public override bool SupportsInverseTransform { get; }

Property Value

bool

Methods

FitCore(Matrix<T>)

Fits Isomap by computing geodesic distances and embedding.

protected override void FitCore(Matrix<T> data)

Parameters

data Matrix<T>

GetFeatureNamesOut(string[]?)

Gets the output feature names after transformation.

public override string[] GetFeatureNamesOut(string[]? inputFeatureNames = null)

Parameters

inputFeatureNames string[]

Returns

string[]

InverseTransformCore(Matrix<T>)

Inverse transformation is not supported.

protected override Matrix<T> InverseTransformCore(Matrix<T> data)

Parameters

data Matrix<T>

Returns

Matrix<T>

TransformCore(Matrix<T>)

Returns the embedding computed during Fit.

protected override Matrix<T> TransformCore(Matrix<T> data)

Parameters

data Matrix<T>

Returns

Matrix<T>