7.1.8. mclearn.classifier.grid_search_svm_poly_degree

mclearn.classifier.grid_search_svm_poly_degree(X, y, param_grid, degree=2, train_size=300, test_size=300)[source]

Do a grid search on a Linear SVM given the specified polynomial transformation.

Parameters:
  • X (array) – The feature matrix of the data.
  • y (array) – The target column.
  • 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.
Returns:

scores_flat – List of scores of all possible cominbations of the hyperparameters.

Return type:

array