Skip to content
Quantoros

Why should standardized features with negative values not be fed directly into chi2 feature selection?

Classic MLLevel: IntermediateChi-square feature constraints

Why should standardized features with negative values not be fed directly into chi2 feature selection?

Hints
  • The score function has input assumptions.
  • Scaling can invalidate them.

Answer

This test expects nonnegative feature values such as counts or frequencies. Use appropriate original/count features or choose a test suitable for the transformed data.

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

Related questions