Home > Blockchain >  What is the purpose of y_test in LSTM?
What is the purpose of y_test in LSTM?

Time:11-11

I am a beginner of LSTM and I have built a simple LSTM model for predicting the stock price. However I don't quite understand the purpose of y_train and y_test for data set preparation and splitting.

When i tried to input x_train and y_train data, that's ok to train up the model. After that i just input x_test data but not input y_test data, the model still can predict the result. Why?

Thank you so much dude

LSTM model built

enter image description here

it can still predict some numbers

CodePudding user response:

The x_test values are the one's you are trying to make a prediction on without having the answers. This represents a real world scenario. You need to compare your y_pred with your y_test values in order to evaluate your model and get a score.

Once the model is deployed and you use real values you won't have any y_test to compare against as you are using unseen data. The test set in model development tries to emulate this in order to test how the model generalizes on real world data.

  • Related