x_trainy_train [:training_samples] [:training_samplesx_testy_test [training_samples:] [training_samples:nowwe need to create linear regressor object reg_linear_mullinear_model linearregression(train the object with the training samples reg_linear_mul fit(x_trainy_trainnowat last we need to do the prediction with the testing data y_test_pred reg_linear_mul predict(x_testprint("performance of linear regressor:"print("mean absolute error ="round(sm mean_absolute_error(y_testy_test_pred) )print("mean squared error ="round(sm mean_squared_error(y_testy_test_pred) )print("median absolute error ="round(sm median_absolute_error(y_testy_test_pred) )print("explain variance score ="round(sm explained_variance_score(y_testy_test_pred) )print(" score ="round(sm _score(y_testy_test_pred) )output performance of linear regressormean absolute error mean squared error median absolute error explain variance score score nowwe will create polynomial of degree and train the regressor we will provide the sample data point polynomial polynomialfeatures(degree= x_train_transformed polynomial fit_transform(x_train