KruskalWallis<T>

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

Kruskal-Wallis H-test for non-parametric feature selection in classification.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

While ANOVA assumes your data follows a bell curve, Kruskal-Wallis makes no such assumption. It ranks all values and checks if different classes tend to have systematically higher or lower ranks. It’s more robust when your data has outliers or isn’t normally distributed.

How It Works

The Kruskal-Wallis test is a non-parametric version of one-way ANOVA. It compares the rank distributions across classes rather than assuming normal distributions. Features that lead to different rank distributions across classes are considered important.

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)