CostSensitiveFS<T>

Models & Types · AiDotNet.Preprocessing.FeatureSelection.CostSensitive

Cost-Sensitive Feature Selection considering feature acquisition costs.

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

Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>

For Beginners

Sometimes getting data for a feature costs money or time. This selector picks features that give you the most predictive power for the least cost. It’s like shopping for ingredients - you want quality ingredients that don’t break your budget.

How It Works

Cost-Sensitive Feature Selection balances the predictive value of features against their acquisition costs. This is important in scenarios where collecting certain features is expensive, time-consuming, or invasive.

Constructors

Constructor Summary
CostSensitiveFS(int nFeaturesToSelect, double costWeight, Vector<T> featureCosts, int[] columnIndices)

Properties

Property Summary
Vector<T> CostBenefitScores { get; }
Vector<T> FeatureCosts { get; }
Vector<T> RelevanceScores { get; }
bool SupportsInverseTransform { get; }
double CostWeight { get; }
int NFeaturesToSelect { get; }
int[] SelectedIndices { get; }

Methods

Method Summary
Matrix<T> FitTransform(Matrix<T> data, Vector<T> target)
T GetTotalCost()
bool[] GetSupportMask()
string[] GetFeatureNamesOut(string[] inputFeatureNames)
void Fit(Matrix<T> data, Vector<T> target)
void Fit(Matrix<T> data, Vector<T> target, Vector<T> featureCosts)