gemseo / mlearning / transform / scaler

min_max_scaler module

Min-max data scaler

The MinMaxScaler class implements the MinMax scaling method applying to some parameter \(z\):

\[\bar{z} := \text{offset} + \text{coefficient}\times z = \frac{z-\text{min}(z)}{(\text{max}(z)-\text{min}(z))},\]

where \(\text{offset}=-\text{min}(z)/(\text{max}(z)-\text{min}(z))\) and \(\text{coefficient}=1/(\text{max}(z)-\text{min}(z))\).

In the MinMax scaling method, the scaling operation linearly transforms the original variable \(z\) such that the minimum of the original data corresponds to 0 and the maximum to 1.

class gemseo.mlearning.transform.scaler.min_max_scaler.MinMaxScaler(name='MinMaxScaler', offset=0.0, coefficient=1.0)[source]

Bases: gemseo.mlearning.transform.scaler.scaler.Scaler

Min-max scaler.

Constructor.

Parameters
  • name (str) – name of the scaler. Default: ‘MinMaxScaler’.

  • offset (float) – offset of the linear transformation. Default: 0.

  • coefficient (float) – coefficient of the linear transformation. Default: 1.

fit(data)[source]

Fit offset and coefficient terms from a data array. The min and the max are computed along the first axis of the data.

Parameters

data (array) – data to be fitted.