【问题标题】:Categorical Encoder in Scikit Learn PreprocessingScikit Learn 预处理中的分类编码器
【发布时间】: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


    【解决方案1】:

    CategoricalEncoder 仅在开发版本 0.20.dev0 中可用。使用OneHotEncoderOrdinalEncoder insted。(见#10521

    【讨论】:

      猜你喜欢
      • 2015-07-30
      • 2016-02-07
      • 2018-11-13
      • 2018-07-07
      • 2016-02-02
      • 2014-02-17
      • 2015-03-01
      • 1970-01-01
      • 2022-01-05
      相关资源
      最近更新 更多