SelectFdr<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Filter.Univariate
Selects features based on a false discovery rate test.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → SelectFdr<T>
Implements: ISupervisedFeatureSelector<T>
For Beginners
FDR correction is more powerful than FPR:
- FPR: “At most 5% of all 1000 features are false positives”
- FDR: “At most 5% of the 50 features I selected are false positives”
- FDR allows more features to be selected while controlling errors
How It Works
SelectFdr applies the Benjamini-Hochberg procedure to control the expected proportion of false discoveries (incorrectly selected features) among the selected features.
Unlike SelectFpr which controls false positives among ALL features, SelectFdr controls false discoveries among SELECTED features only.
Constructors
| Constructor | Summary |
|---|---|
SelectFdr(double alpha, SelectKBestScoreFunc scoringFunction, int[] columnIndices) |
Creates a new instance of SelectFdr. |
Properties
| Property | Summary |
|---|---|
SelectKBestScoreFunc ScoringFunction { get; } |
Gets the scoring function used. |
Vector<T> AdjustedPValues { get; } |
Gets the FDR-adjusted p-values. |
Vector<T> PValues { get; } |
Gets the original p-values for each feature. |
Vector<T> Scores { get; } |
Gets the scores for each feature. |
bool SupportsInverseTransform { get; } |
Gets whether this transformer supports inverse transformation. |
double Alpha { get; } |
Gets the significance level (alpha) for FDR control. |
int[] SelectedIndices { get; } |
Gets the indices of selected features. |
Methods
| Method | Summary |
|---|---|
Matrix<T> FitTransform(Matrix<T> data, Vector<T> target) |
Fits and transforms the data. |
bool[] GetSupportMask() |
Gets the support mask indicating which features are selected. |
string[] GetFeatureNamesOut(string[] inputFeatureNames) |
Gets the output feature names after transformation. |
void Fit(Matrix<T> data, Vector<T> target) |
Fits the selector by computing FDR-adjusted p-values. |