gemseo / mlearning / transformers / power

Show inherited members

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=None, standardize=True)[source]

Bases: Power

A Yeo-Johnson power transformation.

Parameters:
  • name (str | None) – A name for this transformer. If None, use the class name.

  • standardize (bool) –

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

    By default it is set to True.

lambdas_: ndarray

The parameters of the power transformation for the selected features.

name: str

The name of the transformer.