我有.npy文件,其中包含3个昏暗的数组。 将重整形应用于数组后,它仍然不起作用。这是代码。
ta = np.load('class_a.npy',mmap_mode='r')
tb = np.load('class_b.npy',mmap_mode='r')
clf = neighbors.KNeighborsClassifier()
ta.reshape(-1)
tb.reshape(-1)
X_train,X_test,y_train,y_test = train_test_split(ta,tb,test_size=0.2)
clf.fit(X_train,y_train)
这是我得到的错误
ValueError: Found array with dim 3. Estimator expected <= 2.
我在做什么错了?