0
$\begingroup$

I choose which transformation to use for my data (data contains both positive and negative values). Wikipedia says the following:

The Yeo – Johnson transformation allows also for zero and negative values of y (https://en.wikipedia.org/wiki/Power_transform).

However, the two-parameter Box-Cox transformation also allows you to work with negative values: enter image description here

When should I use the two-parameter box-cox transformation and when should I use the Yeo – Johnson transformation?

$\endgroup$

1 Answer 1

1
$\begingroup$

Box-Cox transformation cannot work with negative values. You can try feeding negative values to the box-cox transformation and it will give you an error.

$\endgroup$
3
  • $\begingroup$ But the two-parameter box-cox equation works for $y >= -\lambda_2$. Why then is there a two-parameter equation if one-parameter equation works with positive values? $\endgroup$
    – SoH
    Dec 27, 2021 at 13:25
  • $\begingroup$ Why is this $\lambda_2$ shift necessary? $\endgroup$
    – SoH
    Dec 27, 2021 at 13:29
  • $\begingroup$ There are 2 formulas of Box Cox, one for positive values and another for negative values. Currently sklearn only supports formula for positive values AFAIK. Check the official doc here: scikit-learn.org/stable/modules/… $\endgroup$
    – spectre
    Dec 27, 2021 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.