yeo_johnson module¶
A Yeo-Johnson power transformation.
Transform \(x\) as:
\[\begin{split}y = & ((x + 1)^\lambda - 1) / \lambda, \text{ for } x \geq 0, \lambda \neq 0 \\\\
& \log(x + 1), \text{ for }x \geq 0, \lambda = 0 \\\\
& -\frac{(1-x)^{2 - \lambda} - 1}{2-\lambda}, \text{for} x < 0, \lambda \neq 2\\\\
& -log(1-x), \text{ for } x < 0, \lambda = 2\end{split}\]
Dependence¶
This transformation algorithm relies on the PowerTransformer
class
of scikit-learn.
- class gemseo.mlearning.transformers.power.yeo_johnson.YeoJohnson(name='', standardize=True)[source]¶
Bases:
Power
A Yeo-Johnson power transformation.
- Parameters:
- compute_jacobian(data)¶
Compute the Jacobian of
transform()
.
- compute_jacobian_inverse(data)¶
Compute the Jacobian of the
inverse_transform()
.
- 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.
- lambdas_: ndarray¶
The parameters of the power transformation for the selected features.