GridSearchCV

GridSearchCV tests all combinations of a hyperparameter grid, evaluates each by cross-validation, and keeps the best one (best_params_, best_estimator_). The cost grows quickly with the size of the grid. It combines with a Pipeline by naming parameters step__parameter.

Example

GridSearchCV(pipe, {'model__C': [0.1, 1, 10]}, cv=5).fit(X_train, y_train)

Related concepts

The whole glossary