Skip to main content

SpectralEmbedding

Laplacian eigenmaps: a spectral embedding from the eigenvectors of the graph Laplacian of a neighbourhood affinity graph.

Algorithm

Constructs an affinity graph (nearest-neighbours by default), forms the normalised Laplacian, and embeds using its smallest non-trivial eigenvectors.

Constructor

Skigen::SpectralEmbedding<Scalar> model(int n_components = 2, int n_neighbors = 5);

Parameters

ParameterDefaultDescription
n_components2Embedding dimensionality.
n_neighbors5Neighbours in the affinity graph.

Methods

MethodDescription
fit_transform(X)Return the embedding.

Fitted Attributes

AccessorDescription
affinity_matrix()The constructed affinity graph.

Example

Skigen::SpectralEmbedding<double> se(2, 5);
auto Y = se.fit_transform(X);
Verified against scikit-learn

This estimator is checked by the parity suite. See the generator tests/parity/generate_manifold_reference.py and the reference fixtures in tests/parity/data/spectral_embedding/, exercised by tests/parity/parity_manifold.cpp.

API Reference

For full signatures see the SpectralEmbedding API Reference.