What is Goodness of Fit?
The goodness of fit of a model explains how well it matches a set of observations. Usually, the goodness of fit indicators summarizes the disparity between observed values and the model’s anticipated values.
As far as a machine learning algorithm is concerned, a good fit is when both the training data error and the test data are minimal. As the algorithm learns, the mistake in the training data for the modal is decreasing over time, and so is the error on the test dataset. If we train for too long, the training dataset performance may continue to decline due to the model being overfitting and learning the irrelevant detail and noise in the training dataset. At the same time, the test set error begins to rise again as the ability of the model to generalize decreases.
Thus the point before the test data set error begins to increase where the model has an excellent ability on both the training dataset and the unknown test dataset is known as the excellent fit of the model.