spyder里不能将数据集直接导入转换器类吗
from sklearn.datasets import load_iris
iris = load_iris()
#%%
from sklearn.preprocessing import StandardScaler # 引入归一化功能
transfer = StandardScaler() # 实例化一个转化器
data01 = transfer.fit_transform(iris.feature) # 将数据进行归一化处理
提示如下:
Traceback (most recent call last):
File "D:\APP\pypy\lib\site-packages\sklearn\utils\__init__.py", line 117, in __getattr__
return self[key]
KeyError: 'feature'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\87224\Desktop\Python-ELM-master\未命名1.py", line 14, in <module>
data01 = transfer.fit_transform(iris.feature) # 将数据进行归一化处理
File "D:\APP\pypy\lib\site-packages\sklearn\utils\__init__.py", line 119, in __getattr__
raise AttributeError(key)
AttributeError: feature
为什么在pycharm上可以直接使用这个转换器类