Regression Data Analysis, Overfitting, Loocv, Crossvalidation, Calibration.
np.sum([(r - pred(fit(t[idx!=i], r[idx!=i], order), t))**2.0 for i in range(n)]) return rss # RSS cannot detect overfitting fig, ax = plt.subplots(1, 2,figsize=(8,3)) for order in range(1, 6): rss= np.sum((r - np.polyval(np.polyfit(t, r, order), t))**2.0) ax[0].scatter(order, rss,