Regression Data Analysis, Overfitting, Loocv, Crossvalidation, Calibration.
and the fitted values, where the fits are performed on the input data by leaving out each data once. You can see the minimum RSS at order=2. def loocv(t, r, fit, pred, order): """Leave one out cross validation(LOOCV) RSS for fitting a polynomial model """ n = len(t) idx = np.arange(n) rss =