# What if the training data and the prediction data are the same?

It is a completely theoretical question. What if the training data and the prediction data are the same? Will it impact the results if I use the same data for model predictions that I have used for training?

Yes, it will impact the results.

In the best case your model will not overfit at all so you could expect the same performance between the training set and a previously unseen set (= normally the testing set). In case your model overfits even a little bit, then your results on the training set will be higher (better) than on unseen data.

The impact depends on the classifier/hyperparameters you are testing. For instance, if you are using a KNearestNeighbors classifer with k=1, then the impact will be extreme as you will have 100% accuracy on whatever training set.

• A difference in performance between training & test set is practically always expected, it has a specific name (generalization gap) and it does not signify overfitting in itself; the telltale signature of overfitting is that your training error continues to decrease while your validation error starts increasing. So, even if there is no overfitting, the performance metrics obtained from the training data alone are practically always expected to be better than the validation (and test) ones. – desertnaut Sep 28 '20 at 12:15
• I agree and did not say that a difference in performance between training and testing set signify overfitting. But overfitting will lead to such a difference. Then, even if the model does not overfit at all, we could expect similar performances. I didn't find useful to get into the details here, but yes, there are other implicit assumptions, so the "could". – etiennedm Sep 28 '20 at 13:34