Machine Learning, Artificial Intelligence, Python, Statistics, Mathematics.
happens! DEG=np.arange(4,20,1) MSE=[] for d in DEG: x=np.arange(0.0,5.01,0.01) P=PolynomialFeatures(d) P=P.fit_transform(np.array(x).reshape(-1,1)) T=np.array(T).reshape(-1,1) reg=LinearRegression().fit(P,T) pred=reg.predict(P) error=0 for i in range(len(pred)): error=error+(pred[i]-T[i])**2