Using GridSearchCV for custom kernel SVM in scikit-learn I would like to use scikit-learn's GridSearchCV() to do a grid search on custom parameters in a kernel I have specified. Specifically, the kernel is of the form

SeqKernel(x, y, orig_kernel, cut_off, order)


Here, orig_kernel is a kernel typically used in SVM learning (such as linear, polynomial, RBF, or sigmoid). I wish to perform a grid search over values of cut_off and order, with the additional caveat that only the pairs such that order $\le$ cut_off are considered. What would be the best way to implement this?
Look at the source code and modify it to meet your conditions.

https://github.com/scikit-learn/scikit-learn/blob/ab93d65/sklearn/model_selection/_search.py#L685