nowwe need to create linear regressor object reg_linearlinear_model linearregression(train the object with the training samples reg_linear fit(x_trainy_trainwe need to do the prediction with the testing data y_test_pred reg_linear predict(x_testnow plot and visualize the data plt scatter(x_testy_testcolor='red'plt plot(x_testy_test_predcolor='black'linewidth= plt xticks(()plt yticks(()plt show(output nowwe can compute the performance of our linear regression as followsprint("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) )