model tuning and selectioneach learning algorithm will have bunch of parameters or hyperparameters associated with it the iterative process of machine learning aims at finding the best set of parameters that give us the model having the best performance for examplethe process of tuning various hyperparameters of random forest algorithmto find the set which gives the best prediction accuracy (or any other performance metricthis process sometimes involves traversing through the parameter spacesearching for the best parameter set do note that even though we mention the term parameter herewe typically indicate the hyperparameters of model scikit-learn provides useful apis that help us navigate this parameter space easily to find the best possible parameter combinations we can use two metaestimators--gridsearchcv and randomizedsearchcv--for facilitating the search of the best parameters gridsearchcvas the name suggestsinvolves providing grid of possible parameters and trying each possible combination among them to arrive at the best one an optimized approach often is to use random search through the possible parameter setthis approach is provided by the randomizedsearchcv api it samples the parameters and avoids the combinatorial explosions that can result in the case of higher number of parameters in addition to the parameter searchthese model selection methods also allow us to use different cross-validation schemes and score functions to measure performance scikit-learn exampleregression models in the first we discussed an example which involved the task of classification in this sectionwe will tackle another interesting machine learning problemthat of regression keep in mind the focus here is to introduce you to the basic steps involved in using some of the scikit-learn library apis we will not try to over-engineer our solution to arrive at the best model future will focus on those aspects with realworld datasets for our regression examplewe will use one of the datasets bundled with the scikit-learn librarythe diabetes dataset the dataset the diabetes dataset is one of the bundled datasets with the scikit-learn library this small dataset allows the new users of the library to learn and experiment various machine learning conceptswith well-known dataset it contains observations of baseline variablesagesexbody mass indexaverage blood pressure and six blood serum measurements for diabetes patients the dataset bundled with the package is already standardized (scaled) they have zero mean and unit norm the response (or target variableis quantitative measure of disease progression one year after baseline the dataset can be used to answer two questionswhat is the baseline prediction of disease progression for future patientswhich independent variables (featuresare important factors for predicting disease progressionwe will try to answer the first question here by building simple linear regression model let' get started by loading the data in [ ]from sklearn import datasets in [ ]diabetes datasets load_diabetes(in [ ] diabetes target in [ ] diabetes data