TTestSelector<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Filter.Statistical

T-Test based feature selection for binary classification.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

The t-test asks “are the average values of this feature significantly different between the two groups?” A high t-statistic means the feature’s values are very different for each class, making it useful for telling them apart.

How It Works

Uses independent samples t-test to measure how well each feature separates two classes. Features with higher t-statistics have significantly different means between classes.

Constructors

Constructor Summary
TTestSelector(int nFeaturesToSelect, 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)