【发布时间】:2020-01-28 23:49:47
【问题描述】:
我试图在 sklearn 中导入分类编码器
from sklearn.preprocessing import CategoricalEncoder
但我得到了错误
ImportError: cannot import name 'CategoricalEncoder' from 'sklearn.preprocessing' (D:\ProgramData\Miniconda3\lib\site-packages\sklearn\preprocessing\__init__.py)
我有 0.21.3 版的 sklearn。
我在网上查看了文档,似乎 CategoricalEncoder 在版本 0.20.dev0 中存在 (https://15359-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable/modules/generated/sklearn.preprocessing.CategoricalEncoder.html) 但在 0.21.3 中不存在 (https://scikit-learn.org/stable/modules/classes.html#module-sklearn.preprocessing)
CategoricalEncoder 发生了什么? 有没有办法我仍然可以使用它?就像我可以导入 2 个版本的 sklearn 并从 0.20.dev0 版本中提取它
【问题讨论】:
标签: python scikit-learn