ForwardSelection<T>
Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Wrapper
Forward Selection (Sequential Forward Selection) for feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ ForwardSelection<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Forward Selection is like building a team one person at a time. At each step, you try adding each remaining candidate and keep the one who helps the most. You continue until your team is the desired size. Simple but can miss feature interactions that only appear together.
How It Works
Starts with an empty set and greedily adds one feature at a time that provides the best improvement until the desired number of features is reached.
Constructors
| Constructor | Summary |
|---|---|
ForwardSelection(int nFeaturesToSelect, Func<Matrix<T>, Vector<T>, int[], T> scoringFunction, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> FeatureScores { 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) |