Table of Contents

Class HessianLLE<T>

Namespace
AiDotNet.Preprocessing.DimensionalityReduction
Assembly
AiDotNet.dll

Hessian Locally Linear Embedding for nonlinear dimensionality reduction.

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

Remarks

Hessian LLE is an improvement over standard LLE that estimates the Hessian (second derivative) of the embedding function. It uses a quadratic form to measure local curvature and produces more globally coherent embeddings.

The algorithm: 1. Find k-nearest neighbors for each point 2. Compute local Hessian estimator using quadratic polynomials 3. Build global Hessian matrix 4. Find embedding by minimizing Hessian-based cost function

For Beginners: Hessian LLE improves on LLE by: - Using curvature information (second derivatives) - Producing more faithful global embeddings - Better handling of manifolds with varying curvature

Use cases:

  • When standard LLE produces distorted embeddings
  • Manifolds with non-uniform curvature
  • When you need more accurate distance preservation

Constructors

HessianLLE(int, int, int?, int[]?)

Creates a new instance of HessianLLE<T>.

public HessianLLE(int nComponents = 2, int nNeighbors = 10, int? randomState = null, int[]? columnIndices = null)

Parameters

nComponents int

Target dimensionality. Defaults to 2.

nNeighbors int

Number of neighbors. Should be > (n_components * (n_components + 3) / 2). Defaults to 10.

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