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

TimerStopping callback #25

Closed rodrigo-arenas closed 3 years ago

rodrigo-arenas commented 3 years ago

This PR implements the TimerStopping callback, this callback stops the optimization if the difference in seconds between the starting time of the first set of hyperparameters fit, and the current generation time is greater than a time threshold.

Remember that this time is checked after each generation fit, so if the first (or any) generation fit takes longer that the threshold, it won't stop the fitting process until is done with the current generation population.

codecov[bot] commented 3 years ago

Codecov Report

Merging #25 (4493a72) into master (e4ac735) will increase coverage by 0.08%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
+ Coverage   96.33%   96.41%   +0.08%     
==========================================
  Files          18       18              
  Lines         545      558      +13     
==========================================
+ Hits          525      538      +13     
  Misses         20       20              
Impacted Files Coverage Δ
sklearn_genetic/callbacks/__init__.py 100.00% <100.00%> (ø)
sklearn_genetic/callbacks/early_stoppers.py 100.00% <100.00%> (ø)
sklearn_genetic/genetic_search.py 99.42% <100.00%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e4ac735...4493a72. Read the comment docs.