we have discussed many evaluation methods in detailand how to apply them given the ground truth and model howeverwe often want to use metrics like auc in model selection using gridsearchcv or cross_val_score luckily scikit-learn provides very simple way to achieve thisvia the scoring argument that can be used in both gridsearchcv and cross_val_score you can simply provide string describing the evaluation metric you want to use sayfor examplewe want to evaluate the svm classifier on the "nine vs resttask on the digits datasetusing the auc score changing the score from the default (accuracyto auc can be done by providing "roc_aucas the scoring parameterin[ ]default scoring for classification is accuracy print("default scoring{}formatcross_val_score(svc()digits datadigits target = ))providing scoring="accuracydoesn' change the results explicit_accuracy cross_val_score(svc()digits datadigits target = scoring="accuracy"print("explicit accuracy scoring{}format(explicit_accuracy)roc_auc cross_val_score(svc()digits datadigits target = scoring="roc_auc"print("auc scoring{}format(roc_auc)out[ ]default scoring explicit accuracy scoring auc scoring similarlywe can change the metric used to pick the best parameters in grid searchcvin[ ]x_trainx_testy_trainy_test train_test_splitdigits datadigits target = random_state= we provide somewhat bad grid to illustrate the pointparam_grid {'gamma'[ ]using the default scoring of accuracygrid gridsearchcv(svc()param_grid=param_gridgrid fit(x_trainy_trainprint("grid-search with accuracy"print("best parameters:"grid best_params_print("best cross-validation score (accuracy)){ }format(grid best_score_)print("test set auc{ }formatroc_auc_score(y_testgrid decision_function(x_test)))print("test set accuracy{ }format(grid score(x_testy_test)) model evaluation and improvement