PearsonCorrelation<T>
Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Filter.Correlation
Pearson Correlation-based feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ PearsonCorrelation<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Pearson correlation measures how well a straight line fits the relationship between a feature and the target. A value of 1 means perfect positive linear relationship, -1 means perfect negative, and 0 means no linear relationship. Good for finding features with linear dependencies.
How It Works
Pearson Correlation measures the linear relationship between each feature and the target variable. Features with higher absolute correlation are considered more predictive.
Constructors
| Constructor | Summary |
|---|---|
PearsonCorrelation(int nFeaturesToSelect, bool useAbsoluteValue, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
bool SupportsInverseTransform { get; } |
|
bool UseAbsoluteValue { get; } |
|
double[] CorrelationScores { 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) |