Table of Contents

Class LTSA<T>

Namespace
AiDotNet.Preprocessing.DimensionalityReduction
Assembly
AiDotNet.dll

Local Tangent Space Alignment for nonlinear dimensionality reduction.

public class LTSA<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>>
LTSA<T>
Implements
IDataTransformer<T, Matrix<T>, Matrix<T>>
Inherited Members

Remarks

LTSA is a manifold learning algorithm that uses local tangent spaces to compute a global embedding. It estimates the tangent space at each point using PCA on neighbors, then aligns these local coordinate systems.

The algorithm: 1. Find k-nearest neighbors for each point 2. Compute local tangent space via PCA on each neighborhood 3. Compute local coordinates in tangent space 4. Align tangent spaces by minimizing reconstruction error

For Beginners: LTSA is an improved version of LLE that: - Uses tangent spaces (local linear approximations) at each point - Better handles points with different local geometries - More mathematically principled than standard LLE

Use cases:

  • When standard LLE produces poor results
  • Manifolds with varying curvature
  • When you need more stable embeddings

Constructors

LTSA(int, int, int?, int[]?)

Creates a new instance of LTSA<T>.

public LTSA(int nComponents = 2, int nNeighbors = 5, int? randomState = null, int[]? columnIndices = null)

Parameters

nComponents int

Target dimensionality. Defaults to 2.

nNeighbors int

Number of neighbors. Defaults to 5.

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 LTSA 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>