Skip forbidden parameter combinations when using GridSearchCV
问题 I want to greedily search the entire parameter space of my support vector classifier using GridSearchCV. However, some combinations of parameters are forbidden by LinearSVC and throw an exception. In particular, there are mutually exclusive combinations of the dual , penalty , and loss parameters: For example, this code: from sklearn import svm, datasets from sklearn.model_selection import GridSearchCV iris = datasets.load_iris() parameters = {'dual':[True, False], 'penalty' : ['l1', 'l2'], \