BatAlgorithmFS<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Wrapper

Bat Algorithm for feature selection optimization.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Bats use echolocation to find food. In this algorithm, each bat represents a feature subset. Bats fly toward better solutions (prey) by adjusting their “frequency” (search behavior) and “loudness” (exploration vs exploitation balance).

How It Works

Uses the Bat Algorithm metaheuristic inspired by the echolocation behavior of bats. Bats emit pulses and adjust their frequency, loudness, and pulse rate to hunt prey.

Constructors

Constructor Summary
BatAlgorithmFS(int nFeaturesToSelect, int populationSize, int maxIterations, double fMin, double fMax, double loudness, double pulseRate, Func<Matrix<T>, Vector<T>, int[], T> fitnessFunction, int? randomState, int[] columnIndices)

Properties

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