Tuning often gains less than people hope, and scikit-learn's defaults are good. So the team adopts a rule before looking at any numbers: keep the tuned settings only if they beat the defaults by more than 0.005 in cross-validation. Then score whichever model wins on the test rows, once.
Task: write tuned_or_default(c_values, gamma_values).
make_classification(n_samples=600, n_features=20, n_informative=6, n_redundant=4, flip_y=0.05, random_state=0).train_test_split(X, y, test_size=0.25, random_state=0, stratify=y).Pipeline([("scale", StandardScaler()), ("model", SVC())]). Its cross-validated score is the mean of cross_val_score on the training rows with cv=5.GridSearchCV on the same pipeline with cv=5, over every combination of c_values for C and gamma_values for gamma. Fit it on the training rows. Its cross-validated score is best_score_."tuned". Otherwise it is "default"."default", fit the default pipeline on the training rows first.Return a dict:
"choice": "tuned" or "default","default_cv" and "tuned_cv": the two cross-validated scores, rounded to 3 decimal places,"test": the chosen model's accuracy on the test rows, rounded to 3 decimal places.Compare unrounded scores when you decide.