SpearmanCorrelationSelector<T>
Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Statistical
Spearman Rank Correlation Feature Selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ SpearmanCorrelationSelector<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Spearman correlation uses ranks instead of actual values. It converts each variable to ranks (1st, 2nd, 3rd, etc.) and then computes the correlation of those ranks. This makes it robust to outliers and able to detect non-linear but monotonic (always increasing or decreasing) relationships.
How It Works
Selects features based on their Spearman rank correlation with the target, which measures monotonic relationships without assuming linearity.
Constructors
| Constructor | Summary |
|---|---|
SpearmanCorrelationSelector(int nFeaturesToSelect, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> CorrelationScores { 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) |