MaxAbsScaler<T>
Models & Types · AiDotNet.Preprocessing.Scalers
Scales each feature by its maximum absolute value.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → MaxAbsScaler<T>
For Beginners
This scaler divides each feature by its largest absolute value:
- The largest value (positive or negative) becomes 1 or -1
- All other values are proportionally scaled
- Zero values remain zero (preserves sparsity)
This is useful when:
- You have sparse data and want to preserve zeros
- You don’t want to center your data
- You want values bounded between -1 and 1
How It Works
Max absolute scaling transforms each feature by dividing by its maximum absolute value, resulting in features with values in the range [-1, 1]. This scaler does not shift or center the data, so it preserves sparsity.
Constructors
| Constructor | Summary |
|---|---|
MaxAbsScaler(int[] columnIndices) |
Creates a new instance of MaxAbsScaler. |
Properties
| Property | Summary |
|---|---|
Vector<T> MaxAbsolute { get; } |
Gets the maximum absolute value of each feature computed during fitting. |
bool SupportsInverseTransform { get; } |
Gets whether this transformer supports inverse transformation. |
Methods
| Method | Summary |
|---|---|
string[] GetFeatureNamesOut(string[] inputFeatureNames) |
Gets the output feature names after transformation. |