joe*_*oel 8 python encoding categorical-data data-science
我无法在 python 3 虚拟环境中的 jupyter notebook 中导入category_encoders模块。
错误
---------------------------------------------------------------------------
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'
Run Code Online (Sandbox Code Playgroud)
“哪个点”的输出
/opt/virtual_env/py3/bin/pip
Run Code Online (Sandbox Code Playgroud)
“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:
Run Code Online (Sandbox Code Playgroud)
“点子列表”的输出
Package Version
------------------- -------
absl-py 0.7.0
astor 0.7.1
backcall 0.1.0
category-encoders 1.3.0
cycler 0.10.0
Run Code Online (Sandbox Code Playgroud)
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
| 归档时间: |
|
| 查看次数: |
15294 次 |
| 最近记录: |