HarmonySearch<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Metaheuristic
Harmony Search for feature selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → HarmonySearch<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Imagine a band trying to write the perfect song. They remember good riffs from past songs (harmony memory) and sometimes try completely new notes (random pitch). The best combinations are kept for future improvisation. In feature selection, we’re looking for the perfect “harmony” of features.
How It Works
Harmony Search is inspired by the improvisation process of musicians. Just as musicians create harmonies by combining notes from memory with random variations, this algorithm creates solutions by mixing previous good solutions with random exploration.
Constructors
| Constructor | Summary |
|---|---|
HarmonySearch(int nFeaturesToSelect, int harmonyMemorySize, int maxIterations, double hmcr, double par, double bw, int? randomState, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> FeatureScores { get; } |
|
bool SupportsInverseTransform { get; } |
|
double HMCR { get; } |
|
double PAR { get; } |
|
int HarmonyMemorySize { get; } |
|
int MaxIterations { 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) |