rodrigo-arenas / Sklearn-genetic-opt

ML hyperparameters tuning and features selection, using evolutionary algorithms.
https://sklearn-genetic-opt.readthedocs.io
MIT License
289 stars 73 forks source link

Curious about metrics in ConsecutiveStopping callbacks #89

Closed antaradas94 closed 2 years ago

antaradas94 commented 2 years ago

was wondering what would be the best way to use a consecutivestopping callback with sklearn hyperperparameter optimization for example with bayessearcv etc?

rodrigo-arenas commented 2 years ago

In this case, ConsecutiveStopping is used to avoid running a model that might get stuck and can't find any more solutions, it's specific to the use case, but a good starting point would be to stop the model if it has run over more than 20% of the total generations without improvement, for example, it has run 20 generations out of 100 without improvement in the fitness.

This callback is not related to batessearchcv and is not meant to, you can find here an example of how to use this inside a model:

https://sklearn-genetic-opt.readthedocs.io/en/stable/notebooks/Digits_decision_tree.html

Let me know if you have more questions

rodrigo-arenas commented 2 years ago

I'm closing this issue, feel free to ask more questions if needed