SpearmanCorrelationSelector<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Similarity

Spearman Rank Correlation based Feature Selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Spearman correlation works on ranks rather than raw values. It detects if one variable consistently increases when another increases, even if the relationship isn’t a straight line. It’s more robust to outliers than Pearson.

How It Works

Selects features based on their Spearman rank correlation with the target, measuring monotonic relationships (not necessarily linear).

Constructors

Constructor Summary
SpearmanCorrelationSelector(int nFeaturesToSelect, int[] columnIndices)

Properties

Property Summary
Vector<T> Correlations { 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)