AntColonyOptimization<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Metaheuristic

Ant Colony Optimization (ACO) for feature selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Imagine ants leaving scent trails as they explore. Better paths get more scent, attracting more ants. Similarly, good feature combinations get stronger “pheromone” signals, guiding the search toward optimal feature subsets.

How It Works

ACO is inspired by how ants find shortest paths using pheromone trails. Each ant constructs a feature subset, and pheromone levels are updated based on the quality of the solutions found.

Constructors

Constructor Summary
AntColonyOptimization(int nFeaturesToSelect, int nAnts, int nIterations, double alpha, double beta, double rho, int? randomState, int[] columnIndices)

Properties

Property Summary
Vector<T> FeatureScores { get; }
Vector<T> Pheromones { get; }
bool SupportsInverseTransform { get; }
int NAnts { get; }
int NFeaturesToSelect { get; }
int NIterations { 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)