Hi,
Sometimes when using GridSearchCV, I realize that in the grid there are certain combinations of hyperparameters that are either incompatible or redundant. For example, when using an MLP, if I specify the following grid:
grid = {'solver': ['sgd', 'adam'], 'learning_rate': ['constant', 'invscaling', 'adaptive']}
then it yields the following ParameterGrid:
[{'learning_rate': 'constant', 'solver': 'sgd'},
{'learning_rate': 'constant', 'solver': 'adam'},
{'learning_rate': 'invscaling', 'solver': 'sgd'},
{'learning_rate': 'invscaling', 'solver': 'adam'},
{'learning_rate': 'adaptive', 'solver': 'sgd'},
{'learning_rate': 'adaptive', 'solver': 'adam'}]
[{'learning_rate': 'constant', 'solver': 'adam'},
{'learning_rate': 'invscaling', 'solver': 'adam'},
{'learning_rate': 'adaptive', 'solver': 'adam'}]
which is then simply removed from the original ParameterGrid.
I wonder if there's a simpler way of doing this. Would it help if we had an additional parameter (something like "grid_exceptions") in GridSearchCV, which would remove these dicts from the list of parameters?
Thanks