Say I'm using GridSearchCV
to search for hyperparameters, and I'm also using a Pipeline
as I (think I) want to preprocess my data:
param_grid = {
'svc__gamma': np.linspace(0.2, 1, 5)
}
pipeline = Pipeline(steps=[('scaler', StandardScaler()), ('svc', SVC())])
search = GridSearchCV(pipeline, param_grid, cv=10)
search.fit(train_x, train_y)
Is there a way to test my assumption that the inclusion of the scaler
step is actually helpful (beyond just removing it and rerunning it)?
i.e., is there a way to write:
param_grid = {
'svc__gamma': np.linspace(0.2, 1, 5),
'scaler': [On, Off]
}
Or is there a different way I should be approaching this?