0
votes

'''model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=10, verbose=2)'''

in the above line of code model is a sequential keras model having layers and is compiled. what is the use of the parameter validaiton_data. the model is going to train on X_train and y_train data. so based on y_train the parameters would be adjusted and back propagation is done. what is the use of validation_data and why is a different data in this case testing data provided.

1

1 Answers

1
votes

During training, (x_train, y_train) data is used to adjust trainable parameters of the model. However, we don't know whether model is overfit or under fit, whether model is going to do well when new data is provided. So, that is the reason why we have validation data (x_test, y_test) to test the accuracy of model on any unseen data.

Depending on training and validation accuracy, we can decide.
- Whether the model is overfit/underfit,
- whether to collect more data,
- do we need to implement regularization technique,
- do we need to use data augmentation techniques,.
- whether we need to do tune hyper parameters etc.