ManhattanDistanceSelector<T>
Models & Types · AiDotNet.Preprocessing.FeatureSelection.Distance
Manhattan Distance based Feature Selection.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → ManhattanDistanceSelector<T>
Implements: IFixedCountFeatureSelector<T>, ISupervisedFeatureSelector<T>
For Beginners
Manhattan distance measures distance by only moving along axes (like city blocks). It’s less sensitive to outliers than Euclidean distance and useful when features have different scales.
How It Works
Selects features that maximize class separation based on Manhattan (L1) distance between class centroids.
Constructors
| Constructor | Summary |
|---|---|
ManhattanDistanceSelector(int nFeaturesToSelect, int[] columnIndices) |
Properties
| Property | Summary |
|---|---|
Vector<T> DistanceScores { 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) |