Machine Learning, Artificial Intelligence, Python, Statistics, Mathematics.
mse_alpha_test=[] pred_alpha_test=[] for d in DEG: x_train=np.arange(0.0,5.01,0.01) P_train=PolynomialFeatures(d) P_train=P_train.fit_transform(np.array(x_train).reshape(-1,1)) T_train=np.array(T).reshape(-1,1) reg=linear_model.Ridge(alpha=a).fit(P_train,T_train) x_test=np.arange(5.0,8.0,0.1)