Relief<T>

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

Relief algorithm for instance-based feature weighting.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

For each sample, Relief looks at its nearest neighbor from the same class (hit) and different class (miss). Good features should be similar to hits and different from misses. This builds up a score for each feature.

How It Works

Relief estimates feature quality by sampling instances and comparing to nearest hits (same class) and misses (different class). Features differentiating 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)