Skip to main content

LocallyLinearEmbedding

LLE: embeds data by preserving the local linear reconstruction weights of each point from its neighbours.

Algorithm

Each point is expressed as a weighted combination of its k nearest neighbours; the embedding minimises the same reconstruction error in low dimensions via a sparse eigenproblem (standard variant).

Constructor

Skigen::LocallyLinearEmbedding<Scalar> model(int n_components = 2, int n_neighbors = 5, Scalar reg = 1e-3);

Parameters

ParameterDefaultDescription
n_components2Embedding dimensionality.
n_neighbors5Neighbours per point.
reg1e-3Regularisation of the local Gram matrix.

Methods

MethodDescription
fit_transform(X)Return the embedding.

Fitted Attributes

AccessorDescription
reconstruction_error()Embedding reconstruction error.

Example

Skigen::LocallyLinearEmbedding<double> lle(2, 5);
auto Y = lle.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/locally_linear_embedding/, exercised by tests/parity/parity_manifold.cpp.

API Reference

For full signatures see the LocallyLinearEmbedding API Reference.