rodrigo-arenas / Sklearn-genetic-opt

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

[FEATURE] Early stopping #143

Closed 1055I3 closed 9 months ago

1055I3 commented 9 months ago

Hi! I would suggest introduction of early stopping parameter for GASearchCV, such as number of generations without change. Perhaps there could be an additional parameter epsilon, so if the change is smaller than epsilon for n generations, the search halts.

GASearchCV(estimator=model, scoring='balanced_accuracy', ..., epsilon=0.05, n_gens_without_change=5)

A more advance approach would be to assume that improvements come with a certain distribution, so that depending on how long the search is running, by how long I mean how many generations, the more generations without change we have, the lower is the probability for improvement. In that case, we can just set a threshold for the probability as an early stopping condition. However, that asking and assuming too much. :smile:

1055I3 commented 9 months ago

Ok. I see that there are callbacks for early stopping. :relieved: