Skip to content
Quantoros

A feature contains zero and negative values. Can you apply Box–Cox directly, and what alternative accepts them?

Classic MLLevel: IntermediatePower-transform domain

A feature contains zero and negative values. Can you apply Box–Cox directly, and what alternative accepts them?

Hints
  • Check each transform's domain.
  • One power family handles both signs.

Answer

Box–Cox requires strictly positive data. Yeo–Johnson supports nonpositive values; fit its parameter on training data and validate whether the transformation helps.

Source and licence: scikit-learn 1.7.2 — preprocessing · BSD-3-Clause · answer: Quantoros editorial

Related questions