为什么在使用stats.boxcox\u normax时会收到PearsonRConstantInputWarning?

2024-10-02 12:37:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图转换我的数据,并通过astats.boxcox_normmax减少某些特性的偏斜,以找到boxcox的最佳值

### Transforming with boxcox normmax
for field in list(all_skewed_features) :
    all_data[field]=boxcox1p(all_data[field],stats.boxcox_normmax(all_data[field]+1))

但我得到了这个错误:

PearsonRConstantInputWarning:
An input array is constant; the correlation coefficent is not defined.

有趣的是,在我第一次运行代码时,我有这个错误,但在另一次运行时,我没有任何错误。 两次转换数据正确吗


Tags: 数据infieldfordatais错误with

热门问题