BenjaminiHochberg<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.HighDimensional

Benjamini-Hochberg procedure for feature selection with FDR control.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

When you test many features, some will look significant just by chance (false positives). This method controls how many of your “discoveries” are actually false. If you set FDR to 0.1, you expect at most 10% of selected features to be false positives.

How It Works

The Benjamini-Hochberg procedure controls the False Discovery Rate (FDR) when testing multiple hypotheses. It sorts p-values and finds the largest k such that p_(k) <= k/m * alpha, where m is the number of tests.

Constructors

Constructor Summary
BenjaminiHochberg(int nFeaturesToSelect, double alpha, int[] columnIndices)

Properties

Property Summary
Vector<T> AdjustedPValues { get; }
Vector<T> PValues { get; }
bool SupportsInverseTransform { get; }
double Alpha { 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)