Using "X_test, y_test" as validation data on Keras I was looking at some examples on how to use Keras for Regression and I came acrossed some tutorials that used X_test and y_test as validation data and then use them again at .predict.
model.fit(x_train,y_train,validation_data=(x_test,y_test),
          callbacks [monitor],verbose=2,epochs=1000)

My understanding is that, if the model needs validation data, you should split the whole dataset into 3 parts (train/validation/test).
Could you please help explain why it is alright to use x_test and y_test as validation data? and Doesn't doing so makes the model know the answers beforehand? Thank you so much for your help.
(Here's the link to some of the tutorials I was looking at
https://github.com/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_04_3_regression.ipynb
https://github.com/PacktWorkshops/The-Deep-Learning-with-Keras-Workshop/blob/master/Chapter05/Activity5.01/Activity5_01.ipynb
)
 A: Validation data in Keras are used to check the model performance after each epoch. So while the model does not learn based on the validation data, it nevertheless checks the learning progress based on the validation set. So you can say that the validation set is engaged in the learning process (e.g. it may guide model selection and stopping rules etc).
Since testing should be done based on data never seen by the model before, using a separate test set (other than training set and validation set) is good practice.
Note that validation_split in Keras' fit() takes the last $x$% of data as the validation set. So if there is stratification in your data, you need to make sure that the dataframe is shuffled rowwise before using validation_split.
A: Your understanding is correct.
However, using the validation set again as the test set is often done if the author knows/presumes that the validation set is large enough to also function as the test set, so there will not be any considerable difference between validation and test error. In other words, the validation set is so huge and representative of the population, that, even though there is leakage, it doesn't matter, at least not for the type of model that is trained.
