Use sklearn's GridSearchCV with a pipeline, preprocessing just once Use sklearn's GridSearchCV with a pipeline, preprocessing just once numpy numpy