gemseo.mlearning.transformers.power.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 YeoJohnson(name='', standardize=True)[source]#

Bases: Power

A Yeo-Johnson power transformation.

Parameters:
  • name (str) --

    A name for this transformer. If None, use the class name.

    By default it is set to "".

  • standardize (bool) --

    Whether to apply zero-mean, unit-variance normalization to the transformed output.

    By default it is set to True.