gemseo / mlearning / transformers / scaler

# min_max_scaler module¶

Scaling a variable with a geometrical linear transformation.

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.

Warning

When $$\text{min}(z)=\text{max}(z)\neq 0$$, we use $$\bar{z}=\frac{z}{\text{min}(z)}-0.5$$. When $$\text{min}(z)=\text{max}(z)=0$$, we use $$\bar{z}=z+0.5$$.

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

Bases: Scaler

Min-max scaler.

Parameters:
• name (str) –

A name for this transformer.

By default it is set to “”.

• offset (float) –

The offset of the linear transformation.

By default it is set to 0.0.

• coefficient (float) –

The coefficient of the linear transformation.

By default it is set to 1.0.

name: str

The name of the transformer.

Scalers

Scalers