gpt4 book ai didi

python - 无法导入 category_encoders 模块

转载 作者:行者123 更新时间:2023-12-03 17:30:56 30 4
gpt4 key购买 nike

我无法导入 category_encoders python 3虚拟环境中jupyter notebook中的模块。

错误

---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-15-86725efc8d1e> in <module>()
9 from plotly import graph_objs
10 from datetime import datetime
---> 11 import category_encoders as ce
12
13 import sklearn

ModuleNotFoundError: No module named 'category_encoders'

“哪个点”的输出
/opt/virtual_env/py3/bin/pip

“pip show category_encoders”的输出是
Name: category-encoders
Version: 1.3.0
Summary: A collection sklearn transformers to encode categorical variables as numeric
Home-page: https://github.com/wdm0006/categorical_encoding
Author: Will McGinnis
Author-email: will@pedalwrencher.com
License: BSD
Location: /opt/virtual_env/py3/lib/python3.6/site-packages
Requires: numpy, pandas, statsmodels, scikit-learn, patsy, scipy
Required-by:

“点子列表”的输出
Package             Version
------------------- -------
absl-py 0.7.0
astor 0.7.1
backcall 0.1.0
category-encoders 1.3.0
cycler 0.10.0

最佳答案

pip install --upgrade category_encoders
现在,
重启你的内核
import category_encoders as...等等等等

还,
您可以查看 sk-learn 的预处理类 CategoricalEncoder ...
from sklearn.preprocessing import CategoricalEncoder
从这里获取 sk-learn,
pip install git+git://github.com/scikit-learn/scikit-learn.git
或简单地说
pip install sklearn

关于python - 无法导入 category_encoders 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54265717/

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