ValueError: cannot reshape array of size 394 into shape (394,24) for GRU

I am trying to get the r-sqaured score of my model (time-series forecasting using GRU). But I cannot reshape my test_y.

split into train and test sets
values = reframed_df.values training_sample =int( len(df) *0.8) train = values[:training_sample, :] test = values[training_sample:, :]

split into input and outputs
train_X, train_y = train[:, :-1], train[:, -1] test_X, test_y = test[:, :-1], test[:, -1]

reshape input to be 3D [samples, time steps, features]
train_X = train_X.reshape((train_X.shape[0], 1, train_X.shape1)) test_X = test_X.reshape((test_X.shape[0], 1, test_X.shape1)) print(train_X.shape, train_y.shape, test_X.shape, test_y.shape)

Then after that, I want to validate my results so I tried to reshape my y:
image

Hey @Jay_Bhie_Santos

When you make a prediction it should match the shape of your test_y (ground truth), and you can’t reshape your test_y to (394 , 24) because you can only reshape if the output shape has the same number of values as input.

If you are working on a time series:
Your train set will be of samples with the number of your window size and when you make predictions, the shape changes according to your Horizon I think. So in that case you will be using the number of horizons at your model output layer.

Not sure what problem you are working on I guess looking at your model output layer might fix this.