I need to implement least square regression to fit polynomials of degree 1-27. I then need to get the leave-one-out error (kfold cross validation where k = n). After doing a lot of research it seems the best way to get the LOO error is to use sklearn cross_val_score(). My problem is I do not know how or if it is possible to use with regression models.
n = len(x) p, res, _, _, _ = numpy.polyfit(x,y,1,full=True) cv = cross_val_score(?, X, y, scoring=mse, cv=n)
I cannot figure out what the estimator would be or how to make it in cross_val_score. Being new to python and these topics make this twice as challenging.