standard_scaler module¶
Scaling a variable with a statistical linear transformation.
The StandardScaler
class implements the Standard scaling method
applying to some parameter \(z\):
where \(\text{offset}=-\text{mean}(z)/\text{std}(z)\) and \(\text{coefficient}=1/\text{std}(z)\).
In this standard scaling method, the scaling operation linearly transforms the original variable math:z such that in the scaled space, the original data have zero mean and unit standard deviation.
Warning
When \(\text{std}(z)=0\) and \(\text{mean}(z)\neq 0\), we use \(\bar{z}=\frac{z}{\text{mean}(z)}-1\). When \(\text{std}(z)=0\) and \(\text{mean}(z)=0\), we use \(\bar{z}=z\).
- class gemseo.mlearning.transformers.scaler.standard_scaler.StandardScaler(name='', offset=0.0, coefficient=1.0)[source]¶
Bases:
Scaler
Standard scaler.
- Parameters:
- compute_jacobian(data, *args, **kwargs)¶
Force a NumPy array to be 2D and evaluate the function
f
with it.
- compute_jacobian_inverse(data, *args, **kwargs)¶
Force a NumPy array to be 2D and evaluate the function
f
with it.
- duplicate()¶
Duplicate the current object.
- Returns:
A deepcopy of the current instance.
- Return type:
- fit(data, *args)¶
Fit the transformer to the data.
- fit_transform(data, *args)¶
Fit the transformer to the data and transform the data.
- inverse_transform(data, *args, **kwargs)¶
Force a NumPy array to be 2D and evaluate the function
f
with it.
- transform(data, *args, **kwargs)¶
Force a NumPy array to be 2D and evaluate the function
f
with it.