TTest<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Filter.Univariate
Student’s t-test for binary classification feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → TTest<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
The t-test asks: are the average values of this feature really different between class 0 and class 1, or could the difference be due to chance? A small p-value (high t-statistic) means the feature genuinely helps separate classes.
How It Works
Performs independent two-sample t-tests between feature values for each class. Features with significant differences between class means are selected as they help distinguish between classes.
Constructors
| Constructor | Summary |
|---|---|
TTest(int nFeaturesToSelect, double pValueThreshold, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> PValues { get; } |
|
Vector<T> TStatistics { 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) |