Why is Pearson correlation undefined for a constant feature?
StatisticsLevel: IntermediateDependence and ranking
Why is Pearson correlation undefined for a constant feature?
Hints
- Inspect the denominator.
- Zero variance removes normalization.
Answer
Its denominator contains that feature's zero standard deviation. Returning zero would confuse undefined association with measured absence of linear association.
Source and licence: SciPy — statistical estimators and hypothesis tests · BSD-3-Clause · answer: Quantoros editorial