degdeg experiment with whether or not to use the logarithm of the word counts (sublinear_tfdegdeg experiment with whether or not to track word counts or simply track whether words occur or not by setting binary to true or false multinomialnb degdeg decide which of the following smoothing methods to use by setting alphadegdeg add-one or laplace smoothing degdeg lidstone smoothing or degdeg no smoothing simple approach could be to train classifier for all those reasonable exploration values while keeping the other parameters constant and checking the classifier' results as we do not know whether those parameters affect each otherdoing it right would require that we train classifier for every possible combination of all parameter values obviouslythis is too tedious for us to do because this kind of parameter exploration occurs frequently in machine learning tasksscikit-learn has dedicated class for it called gridsearchcv it takes an estimator (an instance with classifier-like interface)which would be the pipeline instance in our caseand dictionary of parameters with their potential values gridsearchcv expects the dictionary' keys to obey certain format so that it is able to set the parameters of the correct estimator the format is as follows____ __ nowif we want to specify the desired values to explore for the min_df parameter of tfidfvectorizer (named vect in the pipeline description)we would have to sayparam_grid={"vect__ngram_range"=[( )( )( )]this would tell gridsearchcv to try out unigramsbigramsand trigrams as parameter values for the ngram_range parameter of tfidfvectorizer then it trains the estimator with all possible parameter/value combinations finallyit provides the best estimator in the form of the member variable best_estimator_ as we want to compare the returned best classifier with our current best onewe need to evaluate it the same way thereforewe can pass the shufflesplit instance using the cv parameter (this is the reason cv is present in gridsearchcv