Relief<T>

Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Filter

Relief algorithm for feature selection based on instance-based learning.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ†’ Relief<T>

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Relief works by looking at individual examples. For each example, it finds the nearest example from the same class (hit) and the nearest from a different class (miss). Good features should have similar values for hits and different values for misses. This intuitive approach works well for detecting local feature relevance.

How It Works

Relief estimates feature quality by sampling instances and computing the difference between distances to nearest hits (same class) and nearest misses (different class). Features that differentiate classes get higher weights.

Constructors

Constructor Summary
Relief(int nFeaturesToSelect, int nIterations, int? randomState, int[] columnIndices)

Properties

Property Summary
Vector<T> FeatureWeights { get; }
bool SupportsInverseTransform { get; }
int NFeaturesToSelect { get; }
int[] SelectedIndices { get; }

Methods

Method Summary
Matrix<T> FitTransform(Matrix<T> data, Vector<T> target)
bool[] GetSupportMask()
string[] GetFeatureNamesOut(string[] inputFeatureNames)
void Fit(Matrix<T> data, Vector<T> target)