When I run
import numpy as np
from sklearn.cluster import MeanShift, estimate_bandwidth
estimate_bandwidth(np.array([1,2,3,4,5,6]))
I get the error
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
I understand that the dimensionality of the array is not correct - but I am not sure what I did wrong here - the code isn't that long. Can estimate_bandwidth only be used with data that is multivariate?
.reshape((6, 1))after the array. Thanks.