【发布时间】:2023-03-11 23:52:02
【问题描述】:
谁能建议如何在 pyscripter 中使用 PCA 内置函数。作为开始,我导入了 pca
from matplotlib.mlab import PCA
然后是代码区,
results = PCA(arr1)
print("-----------------------PCA-----------------------")
print(results)
其中 arr1 是从文件中读取的数据集(数字)。但我收到 Attrubute 错误:
Traceback (most recent call last):
File "C:\Users\pooja\Documents\project\traingsom.py", line 282, in <module>
results = PCA(arr1)
File "C:\Python27\lib\site-packages\matplotlib\mlab.py", line 845, in __init__
n, m = a.shape
AttributeError: 'list' object has no attribute 'shape'
请帮忙..
【问题讨论】:
标签: python pca pyscripter