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
TThe numeric type for calculations (e.g., float, double).
- Inheritance
-
HessianLLE<T>
- Implements
- 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
nComponentsintTarget dimensionality. Defaults to 2.
nNeighborsintNumber of neighbors. Should be > (n_components * (n_components + 3) / 2). Defaults to 10.
randomStateint?Random seed for reproducibility.
columnIndicesint[]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
NNeighbors
Gets the number of neighbors.
public int NNeighbors { get; }
Property Value
SupportsInverseTransform
Gets whether this transformer supports inverse transformation.
public override bool SupportsInverseTransform { get; }
Property Value
Methods
FitCore(Matrix<T>)
Fits Hessian LLE and computes the embedding.
protected override void FitCore(Matrix<T> data)
Parameters
dataMatrix<T>
GetFeatureNamesOut(string[]?)
Gets the output feature names after transformation.
public override string[] GetFeatureNamesOut(string[]? inputFeatureNames = null)
Parameters
inputFeatureNamesstring[]
Returns
- string[]
InverseTransformCore(Matrix<T>)
Inverse transformation is not supported.
protected override Matrix<T> InverseTransformCore(Matrix<T> data)
Parameters
dataMatrix<T>
Returns
- Matrix<T>
TransformCore(Matrix<T>)
Returns the embedding computed during Fit.
protected override Matrix<T> TransformCore(Matrix<T> data)
Parameters
dataMatrix<T>
Returns
- Matrix<T>