SelectPercentile<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection

Select features based on percentile of the highest scores.

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

Implements: ISupervisedFeatureSelector<T>

For Beginners

Instead of saying “give me the best 5 features”, you say “give me the best 10% of features”. This is useful when you don’t know the total number of features ahead of time or want a proportional selection.

How It Works

SelectPercentile is similar to SelectKBest but instead of selecting a fixed number of features, it selects features that score in the top percentile (e.g., top 10%).

Constructors

Constructor Summary
SelectPercentile(double percentile, Func<Matrix<T>, Vector<T>, Vector<T>> scoreFunc, UnivariateScoreFunction defaultScoreFunc, int[] columnIndices)

Properties

Property Summary
Vector<T> PValues { get; }
Vector<T> Scores { get; }
bool SupportsInverseTransform { get; }
double Percentile { 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)