SpikeAndSlabSelector<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Bayesian
Spike-and-Slab Feature Selection using Bayesian variable selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → SpikeAndSlabSelector<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Imagine a spike-and-slab as two possibilities for each feature: either it has no effect (spike at zero) or it has some effect (spread out slab). The method estimates which possibility is more likely for each feature. If the slab is more likely, the feature is important.
How It Works
Implements the spike-and-slab prior model where each feature coefficient has a mixture prior: a “spike” (concentrated at zero) and a “slab” (diffuse). Features with high probability of being in the slab are selected.
Constructors
| Constructor | Summary |
|---|---|
SpikeAndSlabSelector(int nFeaturesToSelect, double slabVariance, double spikeVariance, double priorInclusionProbability, int nIterations, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> InclusionProbabilities { 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) |