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,
int max_iter = 100,
Scalar tol = 1e-6,
std::string method = "standard");

Parameters

ParameterDefaultDescription
n_components2Embedding dimensionality.
n_neighbors5Neighbours per point.
reg1e-3Regularisation of the local Gram matrix.
method"standard"LLE variant: standard, modified, hessian, or ltsa.

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.