0

I'm training a model with a 4 day look back and 4 days future forecast. The last 4 days will be acting as a feature for the next days.

In that case if i have x_test as [[1,2,3,4],[5,6,7,8]] and y_test[[0.1,0.2,0.3,0.4],[0.5,0.6,0.7,0.8]]

if we do a model.predict(x_test[0]), the result y(hat) we need to comapare with y[1].

So how is model.evaluate() doing this comparison? if we comapre y(hat)[0] with y[0], it is wrong right?

kiranr
  • 2,087
  • 14
  • 32
VYSHAGH A
  • 3
  • 2
  • take a look at this [post](https://stackoverflow.com/questions/44843581/what-is-the-difference-between-model-fit-an-model-evaluate-in-keras) – kiranr Feb 13 '21 at 13:00

1 Answers1

0

As you mentioned, if we give values for consecutive days then we can use the second set of 4 values to evaluate model predictions of the first set of 4. [ it is called the rolling window validation method]
But, Since your dataset is in the form of input - [first 4 values] / label - [next 4 values], here we do not need to evaluate result of x_test[0] with y[1] because the actual y value for x_test[0] is in the y[0].

nipun
  • 672
  • 5
  • 11
  • Sorry. I think i gave the wrong example here. I was referring to rolling window validation only. x_test as [[1,2,3,4],[2,3,4,5]] and y_test[[0.1,0.2,0.3,0.4],[,0.2,0.3,0.4,0.5]] . In this case how model.evaluate of keras works? – VYSHAGH A Feb 13 '21 at 15:12
  • isn't it suppose to be the same? because we manually transform the dataset into consecutive sets of 4 and use those to predict and validate with related labels. this is possible and correct if only you train the model using the same like this. – nipun Feb 14 '21 at 01:57
  • oh..got it..while constructing x_test, y_test same transforming function which i used to create train set, will take care of this..understood – VYSHAGH A Feb 14 '21 at 06:23