Machine Learning, Artificial Intelligence, Python, Statistics, Mathematics.
pred=reg.predict(P_train) error=0 for i in range(len(pred)): error=error+(pred[i]-T[i])**2 MSE.append(error/len(pred)) x_test=np.arange(5.0,8.0,0.1) P_test=PolynomialFeatures(d) P_test=P_test.fit_transform(np.array(x_test).reshape(-1,1)) T_test=t(x_test) T_test=np.array(T_test).reshape(-1,1)