ConstraintBasedSelector<T>

Models & Types ยท AiDotNet.Preprocessing.FeatureSelection.Constraint

Constraint-based Feature Selection with domain constraints.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> โ†’ ConstraintBasedSelector<T>

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Sometimes domain experts know certain features must be included (like patient age in medical data) or must be excluded (like sensitive personal info). This method respects those rules while still finding the best possible feature subset.

How It Works

Selects features while respecting domain-specific constraints such as mandatory features that must be included, forbidden features that must be excluded, and group constraints where features must be selected together.

Constructors

Constructor Summary
ConstraintBasedSelector(int nFeaturesToSelect, int[] mandatoryFeatures, int[] forbiddenFeatures, int[][] featureGroups, int[] columnIndices)

Properties

Property Summary
Vector<T> FeatureScores { 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)