简体   繁体   中英

How does model.evaluate() work in tensorflow?

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?

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] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM