topo.layouts.isomap
Functions
|
Isomap embedding of a dataset or precomputed graph. |
Module Contents
- topo.layouts.isomap.Isomap(X, n_components=2, n_neighbors=50, metric='cosine', landmarks=None, landmark_method='kmeans', eig_tol=0, n_jobs=1, **kwargs)
Isomap embedding of a dataset or precomputed graph.
Computes geodesic distances on the kNN graph, applies double-centering to the squared distance matrix (classical MDS kernel), and returns the top eigenvectors scaled by the square root of the corresponding eigenvalues — the standard Isomap procedure.
- Parameters:
X (array-like or sparse) – Input data matrix of shape (n_samples, n_features), or a precomputed kNN graph (sparse) when
metric='precomputed'.n_components (int, default 2) – Number of dimensions to embed into.
n_neighbors (int, default 50) – Number of neighbors used to build the kNN graph (ignored when
metric='precomputed').metric (str, default 'cosine') – Distance metric for the kNN graph. Pass
'precomputed'ifXis already a sparse adjacency matrix.landmarks (int or array-like of int, optional) – If an
int, the number of landmarks to select (usinglandmark_method). If an array, the explicit landmark indices. When set, only the landmark-to-landmark geodesic sub-matrix is used.landmark_method ({'kmeans', 'random'}, default 'kmeans') – Method for landmark selection when
landmarksis an integer.eig_tol (float, default 0) – Stopping tolerance for the eigendecomposition (passed to ARPACK).
n_jobs (int, default 1) – Number of parallel jobs for kNN construction and shortest-path computation.
**kwargs – Additional keyword arguments forwarded to
topo.base.ann.kNN().
- Returns:
Y (ndarray of shape (n_samples, n_components)) – Isomap embedding coordinates.