why is it necessary to divide the data set into training and testing set while running a particular model? what is the significance of such partition? why is it not possible to get a model for test data with the same prediction accuracy as the training data?
1 Answer
Ultimately your goal is not to perform prediction on a training data set but to test it on new unseen data set.
Hence reporting the performance on the testing data is a simulation of the performance of new unseen data set. Hence, in reporting the performance, we would like to keep some data and not using them in training our model and see how would our model perform.
This would avoid the problem of overfitting where we build model that learn too well on the training data and generalizes poorly.
You might like to check out on $k$-fold cross-validation as well.