PartialCorrelation<T>

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

Partial Correlation for feature selection controlling for other variables.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Regular correlation can be misleading if two variables are both caused by a third (confounder). Partial correlation “holds constant” other variables to find the true direct relationship.

How It Works

Partial correlation measures the relationship between two variables while controlling for (removing the effect of) other variables. Helps identify direct relationships vs those mediated by confounders.

Constructors

Constructor Summary
PartialCorrelation(int nFeaturesToSelect, bool controlForAllOthers, int[] columnIndices)

Properties

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