我正在尝试从Sklearn导入StandardScalar,但需要进行预处理,但这总是给我一个错误。
这是确切的错误:
ImportError Traceback (most recent call last)
<ipython-input-6-1f73df509116> in <module>
----> 1 from sklearn.preprocessing import StandardScalar
ImportError: cannot import name 'StandardScalar' from 'sklearn.preprocessing' (c:\users\abhijith rao\appdata\local\programs\python\python37-32\lib\site-packages\sklearn\preprocessing\__init__.py)
from sklearn.preprocessing import StandardScalar
答案 0 :(得分:2)
造型错误
StandardScalar-> StandardScaler
https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html
答案 1 :(得分:0)
是StandardScaler而不是StandardScalar 所以, 将行“ from sklearn.preprocessing import StandardScalar”替换为 “从sklearn.preprocessing导入StandardScaler”