plt yticks(range(len(param_grid['polynomialfeatures__degree']))param_grid['polynomialfeatures__degree']plt colorbar(figure - heat map of mean cross-validation score as function of the degree of the polynomial features and alpha parameter of ridge looking at the results produced by the cross-validationwe can see that using polynomials of degree two helpsbut that degree-three polynomials are much worse than either degree one or two this is reflected in the best parameters that were foundin[ ]print("best parameters{}format(grid best_params_)out[ ]best parameters{'polynomialfeatures__degree' 'ridge__alpha' which lead to the following scorein[ ]print("test-set score{ }format(grid score(x_testy_test))out[ ]test-set score let' run grid search without polynomial features for comparisonin[ ]param_grid {'ridge__alpha'[ ]pipe make_pipeline(standardscaler()ridge()grid gridsearchcv(pipeparam_gridcv= grid fit(x_trainy_trainprint("score without poly features{ }format(grid score(x_testy_test)) algorithm chains and pipelines