KnockoffFilter<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.HighDimensional

Knockoff Filter for high-dimensional feature selection with FDR control.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → KnockoffFilter<T>

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

When testing many features, some will look important just by chance. The Knockoff Filter creates fake versions of each feature and asks: “Is the real feature more predictive than its fake twin?” This helps avoid selecting features that only appear important by luck.

How It Works

The Knockoff Filter creates “knockoff” versions of each feature that mimic the correlation structure but are conditionally independent of the target. By comparing real features against their knockoffs, it controls the False Discovery Rate (FDR).

Constructors

Constructor Summary
KnockoffFilter(int nFeaturesToSelect, double fdrThreshold, int? randomState, int[] columnIndices)

Properties

Property Summary
Vector<T> FeatureStatistics { get; }
Vector<T> KnockoffStatistics { get; }
bool SupportsInverseTransform { get; }
double FDRThreshold { 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)