ARDKernel<T>
Models & Types · AiDotNet.Kernels
Implements the Automatic Relevance Determination (ARD) kernel with per-dimension length scales.
Implements: IKernelFunction<T>
For Beginners
The ARD (Automatic Relevance Determination) kernel is a powerful extension of the standard RBF kernel that uses a different length scale for each input dimension.
In mathematical terms: k(x, x’) = σ² × exp(-0.5 × Σᵢ (xᵢ - x’ᵢ)² / lᵢ²)
Where:
- σ² is the overall variance (signal variance)
- lᵢ is the length scale for dimension i
How It Works
Why is ARD important?
- Feature Selection: The length scales tell you which features are important:
- Small lᵢ → Feature i is very relevant (small changes matter a lot)
- Large lᵢ → Feature i is less relevant (can be ignored)
- Very large lᵢ → Feature i is essentially irrelevant
- Dimensionality Handling: In high-dimensional problems, not all features matter equally.
ARD automatically figures out which ones are important.
- Interpretability: After training, inspect the length scales to understand
which features drive your predictions.
- Regularization: By learning length scales, the model avoids overfitting
to irrelevant features.
How it works:
- Start with some initial length scales
- Optimize them by maximizing the log marginal likelihood
- Features with large optimized length scales can be pruned
Constructors
| Constructor | Summary |
|---|---|
ARDKernel(Vector<T> lengthScales) |
Initializes a new ARD kernel with specified length scales. |
ARDKernel(Vector<T> lengthScales, double variance) |
Initializes a new ARD kernel with per-dimension length scales and a signal variance. |
ARDKernel(int numDimensions, double lengthScale, double variance) |
Initializes a new ARD kernel with uniform length scales. |
Methods
| Method | Summary |
|---|---|
T Calculate(Vector<T> x1, Vector<T> x2) |
Calculates the ARD kernel value between two vectors. |
Vector<T> GetLengthScales() |
Gets the current length scales. |
double GetVariance() |
Gets the signal variance. |