Table of Contents

Class ModifiedLLE<T>

Namespace
AiDotNet.Preprocessing.DimensionalityReduction
Assembly
AiDotNet.dll

Modified Locally Linear Embedding with regularization.

public class ModifiedLLE<T> : TransformerBase<T, Matrix<T>, Matrix<T>>, IDataTransformer<T, Matrix<T>, Matrix<T>>

Type Parameters

T

The numeric type for calculations (e.g., float, double).

Inheritance
TransformerBase<T, Matrix<T>, Matrix<T>>
ModifiedLLE<T>
Implements
IDataTransformer<T, Matrix<T>, Matrix<T>>
Inherited Members

Remarks

Modified LLE adds regularization to the standard LLE algorithm to improve numerical stability when the number of neighbors exceeds the input dimensionality.

The algorithm: 1. Find k-nearest neighbors for each point 2. Compute reconstruction weights with regularization 3. Compute embedding by minimizing reconstruction error

For Beginners: Modified LLE is more stable than standard LLE: - Works better when you have many neighbors - Less sensitive to noise - Produces more consistent results

Use cases:

  • When standard LLE is unstable
  • High number of neighbors relative to dimensions
  • Noisy data

Constructors

ModifiedLLE(int, int, double, int?, int[]?)

Creates a new instance of ModifiedLLE<T>.

public ModifiedLLE(int nComponents = 2, int nNeighbors = 5, double regParam = 0.001, int? randomState = null, int[]? columnIndices = null)

Parameters

nComponents int

Target dimensionality. Defaults to 2.

nNeighbors int

Number of neighbors. Defaults to 5.

regParam double

Regularization parameter. Defaults to 1e-3.

randomState int?

Random seed for reproducibility.

columnIndices int[]

The column indices to use, or null for all columns.

Properties

Embedding

Gets the embedding result.

public double[,]? Embedding { get; }

Property Value

double[,]

NComponents

Gets the number of components (dimensions).

public int NComponents { get; }

Property Value

int

NNeighbors

Gets the number of neighbors.

public int NNeighbors { get; }

Property Value

int

SupportsInverseTransform

Gets whether this transformer supports inverse transformation.

public override bool SupportsInverseTransform { get; }

Property Value

bool

Methods

FitCore(Matrix<T>)

Fits Modified LLE and computes the embedding.

protected override void FitCore(Matrix<T> data)

Parameters

data Matrix<T>

GetFeatureNamesOut(string[]?)

Gets the output feature names after transformation.

public override string[] GetFeatureNamesOut(string[]? inputFeatureNames = null)

Parameters

inputFeatureNames string[]

Returns

string[]

InverseTransformCore(Matrix<T>)

Inverse transformation is not supported.

protected override Matrix<T> InverseTransformCore(Matrix<T> data)

Parameters

data Matrix<T>

Returns

Matrix<T>

TransformCore(Matrix<T>)

Returns the embedding computed during Fit.

protected override Matrix<T> TransformCore(Matrix<T> data)

Parameters

data Matrix<T>

Returns

Matrix<T>