Skip to main content

Isomap

#include <Skigen/Manifold>

template <typename Scalar = double>
class Skigen::Isomap(n_components=2, n_neighbors=5)

Isometric Mapping (Isomap).

Non-linear dimensionality reduction that preserves geodesic distances between all pairs of points. The algorithm builds a K-nearest-neighbours graph, computes shortest-path (geodesic) distances with Dijkstra's algorithm, then applies classical (metric) MDS via eigendecomposition of the double-centred squared distance matrix.

Mirrors sklearn.manifold.Isomap.


Parameters:

  • n_components : int, default=2 Embedding dimensionality (default 2).

  • n_neighbors : int, default=5 Number of nearest neighbours for the graph (default 5).


Attributes:

  • embedding : MatrixType Embedding coordinates (n_samples x n_components).

  • dist_matrix : MatrixType Geodesic (shortest-path) distance matrix (n_samples x n_samples).


Methods

SKIGEN_PARAMS()

Fit the Isomap model.

Builds a KNN graph from the Euclidean distances of X, computes all-pairs shortest paths via Dijkstra, then applies classical MDS (double-centring + eigendecomposition) to obtain the embedding.

Parameters:

  • X Data matrix of shape (n_samples, n_features).

Returns:

  • result Reference to the fitted transformer (*this).

transform()

Return the stored embedding.

For Isomap the transform simply returns the embedding computed during fit. The input X is expected to match the training data.

Parameters:

  • X Data matrix (ignored; the stored embedding is returned).

Returns:

  • result : MatrixType The embedding matrix (n_samples x n_components).