Skip to main content

LocallyLinearEmbedding

#include <Skigen/Manifold>

template <typename Scalar = double>
class Skigen::LocallyLinearEmbedding(n_components=2, n_neighbors=5, reg=1e-3, max_iter=100, tol=1e-6)

Locally Linear Embedding (LLE).

Nonlinear dimensionality reduction that preserves local neighborhood structure. Each point is reconstructed as a weighted linear combination of its K nearest neighbors; the embedding is then found by minimising the same reconstruction error in the low-dimensional space.

Mirrors sklearn.manifold.LocallyLinearEmbedding.


Parameters:

  • n_components : int, default=2 Number of embedding dimensions (default 2).

  • n_neighbors : int, default=5 Number of nearest neighbors (default 5).

  • reg : Scalar, default=1e-3 Regularisation added to the local covariance matrix (default 1e-3).

  • max_iter : int, default=100 Reserved for iterative eigen solvers (default 100).

  • tol : Scalar, default=1e-6 Convergence tolerance (default 1e-6).


Attributes:

  • embedding : MatrixType Embedding vectors of shape (n_samples, n_components).

  • reconstruction_error : Scalar Sum of squared reconstruction residuals.


Methods

SKIGEN_PARAMS()

Fit the LLE model: compute an embedding of X.

Parameters:

  • X Input data of shape (n_samples, n_features).

Returns:

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

transform(X)

Return the stored embedding (same as fit result).

Because standard LLE has no out-of-sample extension, transform returns the embedding computed during fit. X is expected to be the same data that was used for fitting.

Parameters:

  • X : MatrixType Data matrix (must match the training data shape).

Returns:

  • result : MatrixType The embedding of shape (n_samples, n_components).