gpt4 book ai didi

python - 导入错误 : cannot import name 'PowerTransformer'

转载 作者:太空狗 更新时间:2023-10-30 02:52:37 26 4
gpt4 key购买 nike

每当我尝试运行代码时

import matplotlib.pyplot as plt

from sklearn.preprocessing import PowerTransformer
ptt = PowerTransformer()
plt.plot(ptt.fit(df))

出现此错误:

ImportError: cannot import name 'PowerTransformer'

我的 scikit-learn 当前版本是 0.19.1

这个错误的原因是什么?

最佳答案

您遇到错误是因为在您使用的 sklearn 版本中 PowerTransformer 不存在。

它仅在 0.20.0 版本中添加。您可以查看 0.20.0 版本的更改日志以获取更多详细信息。

要解决此问题,请升级您的 sklearn 版本。

如果你在conda上你可以做

conda 更新 scikit-learn

升级你的sklearn

关于python - 导入错误 : cannot import name 'PowerTransformer' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52621438/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com