IndexError:用于scikit-learn的数组索引太多

时间:2017-05-12 09:52:24

标签: python arrays scikit-learn

当我跑步时

import numpy as np
from sklearn.cluster import MeanShift, estimate_bandwidth
estimate_bandwidth(np.array([1,2,3,4,5,6]))

我收到错误

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "[..]/anaconda2/envs/reifen/lib/python2.7/site-packages/sklearn/cluster/mean_shift_.py", line 72, in estimate_bandwidth
    d, _ = nbrs.kneighbors(X[batch, :], return_distance=True)
IndexError: too many indices for array

我理解数组的维数不正确 - 但我不确定我在这里做错了什么 - 代码不长。 estimate_bandwidth只能用于多变量数据吗?

0 个答案:

没有答案