WhaleOptimization<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Metaheuristic

Whale Optimization Algorithm (WOA) for feature selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Humpback whales hunt by swimming in spirals, creating a “net” of bubbles around fish. This algorithm mimics that spiral approach to find good solutions. It balances exploring new areas (random search) with refining promising ones (spiral update).

How It Works

WOA mimics the bubble-net hunting strategy of humpback whales. It uses encircling prey, bubble-net attacking, and random search phases.

Constructors

Constructor Summary
WhaleOptimization(int nFeaturesToSelect, int populationSize, int maxIterations, double spiralConstant, int? randomState, int[] columnIndices)

Properties

Property Summary
Vector<T> FeatureScores { get; }
bool SupportsInverseTransform { get; }
double SpiralConstant { get; }
int MaxIterations { get; }
int NFeaturesToSelect { 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)