AttentionBasedSelector<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Neural
Attention-based Feature Selection using neural attention mechanisms.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → AttentionBasedSelector<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Attention is like a spotlight that tells the model where to focus. Features that get more “spotlight” (higher attention) are more important for making predictions. This method learns those importance weights automatically from the data.
How It Works
Uses an attention mechanism to learn feature importance weights. The attention scores indicate which features the model focuses on when making predictions.
Constructors
| Constructor | Summary |
|---|---|
AttentionBasedSelector(int nFeaturesToSelect, int hiddenSize, int nEpochs, double learningRate, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> AttentionScores { 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) |