したがって、基本的に私は2つのnumpy配列x_chunk
とそれぞれy_chunk
の次元を持っ[10,512,512,50]
ています。[10,13107200]
コードを使用して寸法に変換しました。
x_chunk=x_chunk.reshape(10,13107200)
y_chunk=y_chunk.reshape(10,13107200)
今、私は を使用してskmultiflow KNN Classifier
おり、これらのデータを使用して適合させようとしていますpartial_fit
model.partial_fit(x_chunk, y_chunk)
しかし、私はこのエラーが発生しています:
ValueError Traceback (most recent call last)
<ipython-input-26-d3e5ffef750e> in <module>()
53 x_chunk=x_chunk.reshape(10,13107200)
54 y_chunk=y_chunk.reshape(10,13107200)
---> 55 model.partial_fit(x_chunk, y_chunk)
56 n_loop += 1
57
/usr/local/lib/python3.6/dist-packages/skmultiflow/lazy/knn.py in partial_fit(self, X, y, classes, weight)
178
179 for i in range(r):
--> 180 self.window.add_element(np.asarray([X[i]]), np.asarray([[y[i]]]))
181 return self
182
/usr/local/lib/python3.6/dist-packages/skmultiflow/utils/data_structures.py in add_element(self, X, y)
968 raise TypeError("None type not supported as the buffer, call configure() to set up the InstanceWindow")
969
--> 970 aux = np.concatenate((X, y), axis=1)
971 self._buffer = np.concatenate((self._buffer, aux), axis=0)
972 self._n_samples += 1
ValueError: all the input arrays must have same number of dimensions
配列の次元は同じでなければならないと言われていますが、両方の配列が同じ次元であるため、何が問題なのですか?
編集
私が使用したモデルは次のとおりです。
from skmultiflow.lazy import KNN
model = KNN(n_neighbors=8, max_window_size=2000, leaf_size=40)