У меня есть набор изображений в 3D-массиве (индекс размеров * высота * ширина).
x_train, x_test, y_train, y_test = train_test_split(X, yy, test_size=0.2, random_state=42, stratify=y)
print(x_train.shape, x_test.shape, y_train.shape, y_test.shape)
dtrain = xgb.DMatrix(data=x_train, label=y_train)
dtest = xgb.DMatrix(data=x_test)
Я получаю сообщение об ошибке ввода XGBoost DMatrix:
ValueError: ('Expecting 2 dimensional numpy.ndarray, got: ', (2164, 120, 431))
Форма массивов из рисунка выше:
(2164, 120, 431) (542, 120, 431) (2164, 3) (542, 3)
Я не совсем понимаю, как изменить данные. Это должно быть 2164 строки * 1 столбец?