skorch
skorch copied to clipboard
Add notebook that shows how to use skorch with optuna
Fixes #718
This notebook shows how to use skorch in conjunction with optuna, which can be much more efficient than GridSearchCV
or RandomizedSearchCV
. I don't have a deep knowledge of optuna, so there may be room for improvement. The whole example is inspired by this one.
Right now, the implementation makes use of the skorch-internal train/valid split. This allows us to use optuna with very few lines of extra code.
Right now, this notebook contains an ad hoc implementation of an OptunaCallback
, which is responsible for logging and pruning trials. Possibly, this could be extended for more functionality. If so, it could find it's way into the skorch code base.
Eventually, we could consider adding a section to the docs about hyper-parameter optimization using different libraries. WDYT?
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Update: optuna already provides a skorch callback, which is almost exactly the same that I used. I changed the notebook to use this instead.
@thomasjpfan I improved the notebook by adding more descriptions, as you correctly pointed out. Now it should be more accessible for users who don't already know optuna. Furthermore, I increased the image size, which was quite small originally.
Closing this as it's super old :)