UCB1Selector<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.Bandit

UCB1 (Upper Confidence Bound) based Feature Selection.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

UCB1 treats feature selection like a slot machine problem. Each feature is an “arm” to pull. We want features that are good (high reward) but also want to try less-tested features that might be better. UCB1 picks features with high estimated value plus an uncertainty bonus. As we “pull” features more, the uncertainty decreases, and we converge to truly good features.

How It Works

Selects features using the UCB1 algorithm from multi-armed bandit theory, balancing exploitation of known good features with exploration of uncertain ones.

Constructors

Constructor Summary
UCB1Selector(int nFeaturesToSelect, int nIterations, double explorationWeight, int? randomState, int[] columnIndices)

Properties

Property Summary
bool SupportsInverseTransform { get; }
double ExplorationWeight { get; }
double[] EstimatedRewards { get; }
double[] UCBScores { get; }
int NFeaturesToSelect { get; }
int NIterations { get; }
int[] PullCounts { 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)