How to reshape ndarray to calculate the mean squared error?
The issue is not the shape of your data. If you would like to calculate any kind of score for either your train or test predictions you need to compare the true labels to the respective predictions (either for the training data or the test data but not mixing these two):

y_train_pred = model.predict(X_train)
mae_train = mean_absolute_error(y_train, y_train_pred)


And correspondingly for your test data:

y_test_pred = model.predict(X_test)
mae_test = mean_absolute_error(y_test, y_test_pred)


(for the example I am assuming that your model object has been assigned to the variable model and used the predict() syntax of SKLearn here)