GeneticAlgorithmSelector<T>
Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Genetic
Genetic Algorithm based Feature Selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ GeneticAlgorithmSelector<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Like natural evolution, this creates a population of different feature combinations, keeps the best ones, combines them to make new combinations, and occasionally mutates them. Over generations, it finds good feature subsets.
How It Works
Uses a genetic algorithm to evolve feature subsets, optimizing for predictive performance through selection, crossover, and mutation.
Constructors
| Constructor | Summary |
|---|---|
GeneticAlgorithmSelector(int nFeaturesToSelect, int populationSize, int nGenerations, double mutationRate, double crossoverRate, int? randomState, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> FeatureImportances { get; } |
|
bool SupportsInverseTransform { get; } |
|
int NFeaturesToSelect { get; } |
|
int NGenerations { get; } |
|
int PopulationSize { 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) |