RFECV<T>
Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Wrapper
Recursive Feature Elimination with Cross-Validation (RFECV).
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ RFECV<T>
Implements: ISupervisedFeatureSelector<T>
For Beginners
Regular RFE requires you to specify how many features to keep. RFECV figures out the best number automatically by testing different counts and seeing which gives the best validation score.
How It Works
RFECV uses cross-validation to find the optimal number of features. It performs RFE for different feature counts and selects the count that maximizes cross-validated performance.
Constructors
| Constructor | Summary |
|---|---|
RFECV(Func<Matrix<T>, Vector<T>, T> scoringFunc, Func<Matrix<T>, Vector<T>, Vector<T>> importanceFunc, int minFeatures, int step, int nFolds, int? randomState, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> CVScores { get; } |
|
bool SupportsInverseTransform { get; } |
|
int MinFeatures { get; } |
|
int OptimalFeatureCount { 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) |