score without poly features as we would expect looking at the grid search results visualized in figure - using no polynomial features leads to decidedly worse results searching over preprocessing parameters together with model parameters is very powerful strategy howeverkeep in mind that gridsearchcv tries all possible combinations of the specified parameters thereforeadding more parameters to your grid exponentially increases the number of models that need to be built grid-searching which model to use you can even go further in combining gridsearchcv and pipelineit is also possible to search over the actual steps being performed in the pipeline (say whether to use standardscaler or minmaxscalerthis leads to an even bigger search space and should be considered carefully trying all possible solutions is usually not viable machine learning strategy howeverhere is an example comparing randomforest classifier and an svc on the iris dataset we know that the svc might need the data to be scaledso we also search over whether to use standardscaler or no preprocessing for the randomforestclassifierwe know that no preprocessing is necessary we start by defining the pipeline herewe explicitly name the steps we want two stepsone for the preprocessing and then classifier we can instantiate this using svc and standardscalerin[ ]pipe pipeline([('preprocessing'standardscaler())('classifier'svc())]now we can define the parameter_grid to search over we want the classifier to be either randomforestclassifier or svc because they have different parameters to tuneand need different preprocessingwe can make use of the list of search grids we discussed in "search over spaces that are not gridson page to assign an estimator to stepwe use the name of the step as the parameter name when we wanted to skip step in the pipeline (for examplebecause we don' need preprocessing for the randomforest)we can set that step to nonein[ ]from sklearn ensemble import randomforestclassifier param_grid {'classifier'[svc()]'preprocessing'[standardscaler()none]'classifier__gamma'[ ]'classifier__c'[ ]}{'classifier'[randomforestclassifier(n_estimators= )]'preprocessing'[none]'classifier__max_features'[ ]}grid-searching which model to use