Is your feature request related to a problem? Please describe.
Currently the .fit method of GASearchCV accepts a callbacks argument, this is used to stop the training process when a condition is met. All the callbacks implements the same methods: .on_step and __call__ which are used while the optimization routine is running.
Currently, each callback does not have any kind of inheritance from a base class that ensures that all the objects have the minimun required methods. At this point, is only checked that is a callable
Describe the solution you'd like
Implemente a BaseCallback class in the sklearn_genetic.callbacks module, all the current callbacks should be updated to be a child class of that base class. It must force that there is a on_step and call methods in the class, otherwise, raise a NotImplementError.
In the check_callback function, it should be checked that the callback is an instance of that base class
Describe alternatives you've considered
Create a base class that controlls all the callbacks that are created fot GASearchCV
Additional context
If possible, update the documentation on the docs/tutorials/custom_callbacks, which explains how to create a callback. Here should put the BaseCallback on the exampled used.
Is your feature request related to a problem? Please describe. Currently the .fit method of GASearchCV accepts a callbacks argument, this is used to stop the training process when a condition is met. All the callbacks implements the same methods:
.on_step
and__call__
which are used while the optimization routine is running. Currently, each callback does not have any kind of inheritance from a base class that ensures that all the objects have the minimun required methods. At this point, is only checked that is a callableDescribe the solution you'd like Implemente a
BaseCallback
class in thesklearn_genetic.callbacks
module, all the current callbacks should be updated to be a child class of that base class. It must force that there is a on_step and call methods in the class, otherwise, raise a NotImplementError. In the check_callback function, it should be checked that the callback is an instance of that base classDescribe alternatives you've considered Create a base class that controlls all the callbacks that are created fot GASearchCV
Additional context If possible, update the documentation on the docs/tutorials/custom_callbacks, which explains how to create a callback. Here should put the BaseCallback on the exampled used.