我收到此ValueError:找到的数组具有暗3。预期的估计量<= 2。 我在此行出现错误
from sklearn.tree import DecisionTreeClassifier
my_decisiontree = DecisionTreeClassifier()
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2,random_state=4)
my_decisiontree.fit(X_train, y_train)
y_predict_dt = my_decisiontree.predict(X_test)
from sklearn.metrics import accuracy_score
print(y_predict_dt)
accuracy = accuracy_score(y_test, y_predict_dt)
print(accuracy)
----> 7 my_decisiontree.fit(X_train, y_train)
ValueError: Found array with dim 3. Estimator expected <= 2.
这是我先前在程序中打印的形状
#convert to array
img_data = np.array(img_data_list)
#convert to float, 0 - 1
img_data = img_data.astype('float32')
#scale
img_data /= 255
print (img_data.shape)
(5856, 64, 64)
我需要重塑吗?以及如何完成?