Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python sklearn 0.22中的sklearn.feature_extraction.FeatureHasher_Python_Hash_Scikit Learn_Feature Extraction - Fatal编程技术网

Python sklearn 0.22中的sklearn.feature_extraction.FeatureHasher

Python sklearn 0.22中的sklearn.feature_extraction.FeatureHasher,python,hash,scikit-learn,feature-extraction,Python,Hash,Scikit Learn,Feature Extraction,我刚刚更新到sklearn 0.22。我的代码以前在以前的版本中工作,但现在它给出了一个错误: from sklearn.feature_extraction import FeatureHasher a = FeatureHasher(n_features = 5, input_type = 'string') 现在它给出了这个错误: Traceback (most recent call last): File "", line 1, in hasher_partner = Featur

我刚刚更新到sklearn 0.22。我的代码以前在以前的版本中工作,但现在它给出了一个错误:

from sklearn.feature_extraction import FeatureHasher
a = FeatureHasher(n_features = 5, input_type = 'string')
现在它给出了这个错误:

Traceback (most recent call last):

File "", line 1, in hasher_partner = FeatureHasher()

File "C:\Users\77797\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\feature_extraction\hashing.py", line 89, in init

File "C:\Users\77797\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\feature_extraction\hashing.py", line 100, in _validate_params

NameError: name 'numbers' is not defined
有什么解决办法吗?
谢谢

您使用的软件包不是
scikit learn
0.22。在回溯中,导入的模块是
hashing.py
,并在0.22中重命名为
\u hashing.py


你能确保你有好版本的scikit学习
import-sklearn;sklearn.\uuuu版本\uuuu
。如果您的版本为0.22,请尝试使用conda重新安装软件包:
conda install scikit learn--force reinstall

numbers
是标准的库软件包。尝试在python中导入数字repl@abhilb谢谢奇怪的是,当我使用
sklearn
时,我不需要导入它!