You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from pyxmeans import XMeans as xmeans
import numpy as np
data = np.array([
[1.0, 1.0],
[1.1, 1.1],
[1.2, 1.2],
[10.0, 10.0],
[10.1, 10.1],
[10.2, 10.2]
])
test = xmeans(2)
test.fit(data)
The output reported the following error:
/usr/local/lib/python2.7/dist-packages/pyxmeans/xmeans.py:135: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if centroids in ('kmeans++', 'random'):
/usr/local/lib/python2.7/dist-packages/pyxmeans/mini_batch.py:109: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if self.init == 'random':
/usr/local/lib/python2.7/dist-packages/pyxmeans/mini_batch.py:111: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
elif self.init == 'kmeans++':
Traceback (most recent call last):
File "test.py", line 14, in <module>
test.fit(data)
File "/usr/local/lib/python2.7/dist-packages/pyxmeans/xmeans.py", line 61, in fit
test_model = self._fit(2, points, np.asarray([new_point1, new_point2]))
File "/usr/local/lib/python2.7/dist-packages/pyxmeans/xmeans.py", line 146, in _fit
).fit(data[:])
File "/usr/local/lib/python2.7/dist-packages/pyxmeans/mini_batch.py", line 131, in fit
self.cluster_centers_ = _minibatch.minibatch(data, self.cluster_centers_, self.n_samples, self.max_iter, self.bic_termination, self.reassignment_ratio)
RuntimeError: more samples requested than data.
Do you know what might be the reason for this error?
Thanks!
The text was updated successfully, but these errors were encountered:
I have the following simple test code:
The output reported the following error:
Do you know what might be the reason for this error?
Thanks!
The text was updated successfully, but these errors were encountered: