7.1.5. mclearn.classifier.grid_search¶
-
mclearn.classifier.
grid_search
(X, y, classifier, param_grid, train_size=300, test_size=300, clf_name=None, report=True)[source]¶ A general grid search routine.
Parameters: - X (array) – The feature matrix of the data.
- y (array) – The target column.
- classifier (Classifier object) – A classifier object that will be used to train and test the data. It should have the same interface as scikit-learn classifiers.
- param_grid (dict) – Dictionary containing the names of the hyperparameters and their associated values which the classifier will be trained with.
- train_size (int) – The size of the training set in each iteration.
- test_size (int) – The size of the test set in each iteration.
- clf_name (str) – The name of the classifier (used for printing of the results).
- report (boolean) – Whether the results (the best hyperparameters) will be printed out.