MinMaxScaler<T>

Models & Types · AiDotNet.Preprocessing.Scalers

Scales features to a given range, typically [0, 1].

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

For Beginners

This scaler squishes all your data into a specific range:

  • The smallest value becomes the minimum of the range (default 0)
  • The largest value becomes the maximum of the range (default 1)
  • Everything else is proportionally scaled in between

This is useful when:

  • Your algorithm requires data in a specific range
  • You want to preserve the relationships between values
  • You don’t want outliers to heavily influence the scaling

How It Works

Min-max scaling transforms features by scaling each feature to a given range. The default range is [0, 1]. The transformation is: X_scaled = (X - X_min) / (X_max - X_min) * (max - min) + min

Constructors

Constructor Summary
MinMaxScaler(double featureRangeMin, double featureRangeMax, int[] columnIndices) Creates a new instance of MinMaxScaler with a custom range.
MinMaxScaler(int[] columnIndices) Creates a new instance of MinMaxScaler with default range [0, 1].

Properties

Property Summary
T FeatureRangeMax { get; } Gets the maximum value of the target feature range.
T FeatureRangeMin { get; } Gets the minimum value of the target feature range.
Vector<T> DataMax { get; } Gets the maximum value of each feature computed during fitting.
Vector<T> DataMin { get; } Gets the minimum 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.