KruskalWallis<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Filter.Statistical
Kruskal-Wallis H test for feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → KruskalWallis<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
When you have more than two groups (like multiple categories), this test checks if the feature values differ across groups. Unlike ANOVA, it doesn’t assume the data follows a bell curve, making it more robust for real-world data.
How It Works
The Kruskal-Wallis H test is a non-parametric alternative to one-way ANOVA. It tests whether samples from different groups have the same distribution, making it useful for multi-class classification problems.
Constructors
| Constructor | Summary |
|---|---|
KruskalWallis(int nFeaturesToSelect, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> HStatistics { get; } |
|
Vector<T> PValues { 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) |