pyVolutionary 2.4.2__tar.gz → 2.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/PKG-INFO +10 -14
  2. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/README.md +6 -7
  3. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyproject.toml +13 -7
  4. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/__init__.py +5 -4
  5. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/abstract.py +33 -12
  6. pyvolutionary-2.4.2/pyvolutionary/gridsearchcv.py → pyvolutionary-2.5.1/pyvolutionary/hypertuner.py +4 -5
  7. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/models.py +12 -0
  8. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/utils.py +1 -60
  9. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/african_vulture/__init__.py +0 -0
  10. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/african_vulture/african_vulture_optimization.py +0 -0
  11. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/african_vulture/models.py +0 -0
  12. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ant_colony/__init__.py +0 -0
  13. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ant_colony/ant_colony_optimization.py +0 -0
  14. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ant_colony/models.py +0 -0
  15. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ant_lion/__init__.py +0 -0
  16. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ant_lion/ant_lion_optimization.py +0 -0
  17. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ant_lion/models.py +0 -0
  18. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/aquila/__init__.py +0 -0
  19. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/aquila/aquila_optimization.py +0 -0
  20. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/aquila/models.py +0 -0
  21. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/archimede/__init__.py +0 -0
  22. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/archimede/archimede_optimization.py +0 -0
  23. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/archimede/models.py +0 -0
  24. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bacterial_foraging/__init__.py +0 -0
  25. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bacterial_foraging/bacterial_foraging_optimization.py +0 -0
  26. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bacterial_foraging/models.py +0 -0
  27. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bat/__init__.py +0 -0
  28. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bat/bat_optimization.py +0 -0
  29. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bat/models.py +0 -0
  30. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/battle_royale/__init__.py +0 -0
  31. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/battle_royale/battle_royale_optimization.py +0 -0
  32. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/battle_royale/models.py +0 -0
  33. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bee_colony/__init__.py +0 -0
  34. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bee_colony/bee_colony_optimization.py +0 -0
  35. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/bee_colony/models.py +0 -0
  36. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/biogeography_based/__init__.py +0 -0
  37. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/biogeography_based/biogeography_based_optimization.py +0 -0
  38. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/biogeography_based/models.py +0 -0
  39. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/brain_storm/__init__.py +0 -0
  40. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/brain_storm/brain_storm_optimization.py +0 -0
  41. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/brain_storm/improved_brain_storm_optimization.py +0 -0
  42. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/brain_storm/models.py +0 -0
  43. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/brown_bear/__init__.py +0 -0
  44. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/brown_bear/brown_bear_optimization.py +0 -0
  45. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/brown_bear/models.py +0 -0
  46. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/camel_caravan/__init__.py +0 -0
  47. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/camel_caravan/camel_caravan_optimization.py +0 -0
  48. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/camel_caravan/models.py +0 -0
  49. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/cat_swarm/__init__.py +0 -0
  50. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/cat_swarm/cat_swarm_optimization.py +0 -0
  51. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/cat_swarm/models.py +0 -0
  52. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/chaos_game/__init__.py +0 -0
  53. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/chaos_game/chaos_game_optimization.py +0 -0
  54. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/chaos_game/models.py +0 -0
  55. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/chernobyl_disaster/__init__.py +0 -0
  56. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/chernobyl_disaster/chernobyl_disaster_optimization.py +0 -0
  57. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/chernobyl_disaster/models.py +0 -0
  58. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coati/__init__.py +0 -0
  59. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coati/coati_optimization.py +0 -0
  60. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coati/models.py +0 -0
  61. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coral_reef/__init__.py +0 -0
  62. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coral_reef/coral_reef_optimization.py +0 -0
  63. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coral_reef/models.py +0 -0
  64. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coronavirus_herd_immunity/__init__.py +0 -0
  65. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coronavirus_herd_immunity/coronavirus_herd_immunity_optimization.py +0 -0
  66. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coronavirus_herd_immunity/models.py +0 -0
  67. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coyotes/__init__.py +0 -0
  68. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coyotes/coyotes_optimization.py +0 -0
  69. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/coyotes/models.py +0 -0
  70. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/cuckoo_search/__init__.py +0 -0
  71. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/cuckoo_search/cuckoo_search_optimization.py +0 -0
  72. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/cuckoo_search/models.py +0 -0
  73. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/dragonfly/__init__.py +0 -0
  74. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/dragonfly/dragonfly_optimization.py +0 -0
  75. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/dragonfly/models.py +0 -0
  76. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/dwarf_mongoose/__init__.py +0 -0
  77. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/dwarf_mongoose/dwarf_mongoose_optimization.py +0 -0
  78. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/dwarf_mongoose/models.py +0 -0
  79. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/earthworms/__init__.py +0 -0
  80. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/earthworms/earthworms_optimization.py +0 -0
  81. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/earthworms/models.py +0 -0
  82. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/egret_swarm/__init__.py +0 -0
  83. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/egret_swarm/egret_swarm_optimization.py +0 -0
  84. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/egret_swarm/models.py +0 -0
  85. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/electromagnetic_field/__init__.py +0 -0
  86. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/electromagnetic_field/electromagnetic_field_optimization.py +0 -0
  87. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/electromagnetic_field/models.py +0 -0
  88. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/elephant_herd/__init__.py +0 -0
  89. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/elephant_herd/elephant_herd_optimization.py +0 -0
  90. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/elephant_herd/models.py +0 -0
  91. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/energy_valley/__init__.py +0 -0
  92. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/energy_valley/energy_valley_optimization.py +0 -0
  93. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/energy_valley/models.py +0 -0
  94. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/enums.py +0 -0
  95. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ficks_law/__init__.py +0 -0
  96. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ficks_law/ficks_law_optimization.py +0 -0
  97. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/ficks_law/models.py +0 -0
  98. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/firefly_swarm/__init__.py +0 -0
  99. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/firefly_swarm/firefly_swarm_optimization.py +0 -0
  100. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/firefly_swarm/models.py +0 -0
  101. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/firehawk/__init__.py +0 -0
  102. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/firehawk/firehawk_optimization.py +0 -0
  103. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/firehawk/models.py +0 -0
  104. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fireworks/__init__.py +0 -0
  105. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fireworks/fireworks_optimization.py +0 -0
  106. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fireworks/models.py +0 -0
  107. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fish_school_search/__init__.py +0 -0
  108. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fish_school_search/fish_school_search_optimization.py +0 -0
  109. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fish_school_search/models.py +0 -0
  110. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/flower_pollination_algorithm/__init__.py +0 -0
  111. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/flower_pollination_algorithm/flower_pollination_algorithm_optimization.py +0 -0
  112. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/flower_pollination_algorithm/models.py +0 -0
  113. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/forensic_based_investigation/__init__.py +0 -0
  114. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/forensic_based_investigation/forensic_based_investigation_optimization.py +0 -0
  115. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/forensic_based_investigation/models.py +0 -0
  116. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/forest_algorithm/__init__.py +0 -0
  117. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/forest_algorithm/forest_optimization_algorithm.py +0 -0
  118. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/forest_algorithm/models.py +0 -0
  119. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fox/__init__.py +0 -0
  120. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fox/fox_optimization.py +0 -0
  121. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/fox/models.py +0 -0
  122. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/gaining_sharing_knowledge_algorithm/__init__.py +0 -0
  123. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/gaining_sharing_knowledge_algorithm/gaining_sharing_knowledge_optimization.py +0 -0
  124. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/gaining_sharing_knowledge_algorithm/models.py +0 -0
  125. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/genetic_algorithm/__init__.py +0 -0
  126. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/genetic_algorithm/classes.py +0 -0
  127. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/genetic_algorithm/genetic_algorithm_optimization.py +0 -0
  128. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/genetic_algorithm/models.py +0 -0
  129. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/germinal_center/__init__.py +0 -0
  130. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/germinal_center/germinal_center_optimization.py +0 -0
  131. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/germinal_center/models.py +0 -0
  132. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/giant_trevally/__init__.py +0 -0
  133. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/giant_trevally/giant_trevally_optimization.py +0 -0
  134. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/giant_trevally/models.py +0 -0
  135. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/giza_pyramid_construction/__init__.py +0 -0
  136. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/giza_pyramid_construction/giza_pyramid_construction_optimization.py +0 -0
  137. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/giza_pyramid_construction/models.py +0 -0
  138. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/golden_jackal/__init__.py +0 -0
  139. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/golden_jackal/golden_jackal_optimization.py +0 -0
  140. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/golden_jackal/models.py +0 -0
  141. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/grasshopper/__init__.py +0 -0
  142. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/grasshopper/grasshopper_optimization_algorithm.py +0 -0
  143. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/grasshopper/models.py +0 -0
  144. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/grey_wolf/__init__.py +0 -0
  145. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/grey_wolf/grey_wolf_optimization.py +0 -0
  146. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/grey_wolf/models.py +0 -0
  147. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/harmony_search/__init__.py +0 -0
  148. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/harmony_search/harmony_search_optimization.py +0 -0
  149. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/harmony_search/models.py +0 -0
  150. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/heap_based/__init__.py +0 -0
  151. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/heap_based/heap_based_optimization.py +0 -0
  152. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/heap_based/models.py +0 -0
  153. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/helpers.py +0 -0
  154. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/henry_gas_solubility/__init__.py +0 -0
  155. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/henry_gas_solubility/henry_gas_solubility_optimization.py +0 -0
  156. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/henry_gas_solubility/models.py +0 -0
  157. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/hunger_games_search/__init__.py +0 -0
  158. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/hunger_games_search/hunger_games_search_optimization.py +0 -0
  159. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/hunger_games_search/models.py +0 -0
  160. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/imperialist_competitive/__init__.py +0 -0
  161. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/imperialist_competitive/classes.py +0 -0
  162. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/imperialist_competitive/imperialist_competitive_optimization.py +0 -0
  163. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/imperialist_competitive/models.py +0 -0
  164. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/invasive_weed/__init__.py +0 -0
  165. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/invasive_weed/invasive_weed_optimization.py +0 -0
  166. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/invasive_weed/models.py +0 -0
  167. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/krill_herd/__init__.py +0 -0
  168. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/krill_herd/krill_herd_optimization.py +0 -0
  169. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/krill_herd/models.py +0 -0
  170. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/levi_jaya_swarm/__init__.py +0 -0
  171. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/levi_jaya_swarm/levy_flight_jaya_swarm_optimization.py +0 -0
  172. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/levi_jaya_swarm/models.py +0 -0
  173. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/marine_predators/__init__.py +0 -0
  174. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/marine_predators/marine_predators_optimization.py +0 -0
  175. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/marine_predators/models.py +0 -0
  176. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/monarch_butterfly/__init__.py +0 -0
  177. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/monarch_butterfly/models.py +0 -0
  178. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/monarch_butterfly/monarch_butterfly_optimization.py +0 -0
  179. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/moth_flame/__init__.py +0 -0
  180. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/moth_flame/models.py +0 -0
  181. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/moth_flame/moth_flame_optimization.py +0 -0
  182. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/mountain_gazelle/__init__.py +0 -0
  183. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/mountain_gazelle/models.py +0 -0
  184. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/mountain_gazelle/mountain_gazelle_optimization.py +0 -0
  185. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/multi_verse/__init__.py +0 -0
  186. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/multi_verse/models.py +0 -0
  187. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/multi_verse/multi_verse_optimization.py +0 -0
  188. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/multitask.py +0 -0
  189. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/nuclear_reaction/__init__.py +0 -0
  190. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/nuclear_reaction/models.py +0 -0
  191. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/nuclear_reaction/nuclear_reaction_optimization.py +0 -0
  192. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/osprey/__init__.py +0 -0
  193. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/osprey/models.py +0 -0
  194. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/osprey/osprey_optimization.py +0 -0
  195. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/particle_swarm/__init__.py +0 -0
  196. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/particle_swarm/models.py +0 -0
  197. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/particle_swarm/particle_swarm_optimization.py +0 -0
  198. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/pathfinder_algorithm/__init__.py +0 -0
  199. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/pathfinder_algorithm/models.py +0 -0
  200. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/pathfinder_algorithm/pathfinder_algorithm_optimization.py +0 -0
  201. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/pelican/__init__.py +0 -0
  202. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/pelican/models.py +0 -0
  203. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/pelican/pelican_optimization.py +0 -0
  204. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/runge_kutta/__init__.py +0 -0
  205. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/runge_kutta/models.py +0 -0
  206. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/runge_kutta/runge_kutta_optimization.py +0 -0
  207. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/salp_swarm/__init__.py +0 -0
  208. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/salp_swarm/models.py +0 -0
  209. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/salp_swarm/salp_swarm_optimization.py +0 -0
  210. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/seagull/__init__.py +0 -0
  211. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/seagull/models.py +0 -0
  212. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/seagull/seagull_optimization.py +0 -0
  213. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/serval/__init__.py +0 -0
  214. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/serval/models.py +0 -0
  215. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/serval/serval_optimization.py +0 -0
  216. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/siberian_tiger/__init__.py +0 -0
  217. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/siberian_tiger/models.py +0 -0
  218. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/siberian_tiger/siberian_tiger_optimization.py +0 -0
  219. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/sine_cosine_algorithm/__init__.py +0 -0
  220. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/sine_cosine_algorithm/classes.py +0 -0
  221. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/sine_cosine_algorithm/models.py +0 -0
  222. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/sine_cosine_algorithm/qle_sine_cosine_algorithm_optimization.py +0 -0
  223. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/sine_cosine_algorithm/sine_cosine_algorithm_optimization.py +0 -0
  224. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/spotted_hyena/__init__.py +0 -0
  225. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/spotted_hyena/models.py +0 -0
  226. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/spotted_hyena/spotted_hyena_optimization.py +0 -0
  227. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/success_history_intelligent/__init__.py +0 -0
  228. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/success_history_intelligent/models.py +0 -0
  229. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/success_history_intelligent/success_history_intelligent_optimization.py +0 -0
  230. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/swarm_hill_climbing/__init__.py +0 -0
  231. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/swarm_hill_climbing/models.py +0 -0
  232. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/swarm_hill_climbing/swarm_hill_climbing_optimization.py +0 -0
  233. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/tasmanian_devil/__init__.py +0 -0
  234. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/tasmanian_devil/models.py +0 -0
  235. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/tasmanian_devil/tasmanian_devil_optimization.py +0 -0
  236. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/tuna_swarm/__init__.py +0 -0
  237. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/tuna_swarm/models.py +0 -0
  238. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/tuna_swarm/tuna_swarm_optimization.py +0 -0
  239. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/virus_colony_search/__init__.py +0 -0
  240. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/virus_colony_search/models.py +0 -0
  241. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/virus_colony_search/virus_colony_search_optimization.py +0 -0
  242. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/walrus/__init__.py +0 -0
  243. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/walrus/models.py +0 -0
  244. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/walrus/walrus_optimization.py +0 -0
  245. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/war_strategy/__init__.py +0 -0
  246. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/war_strategy/models.py +0 -0
  247. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/war_strategy/war_strategy_optimization.py +0 -0
  248. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/water_cycle/__init__.py +0 -0
  249. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/water_cycle/models.py +0 -0
  250. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/water_cycle/water_cycle_optimization.py +0 -0
  251. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/whales/__init__.py +0 -0
  252. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/whales/models.py +0 -0
  253. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/whales/whales_optimization.py +0 -0
  254. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/wildebeest_herd/__init__.py +0 -0
  255. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/wildebeest_herd/models.py +0 -0
  256. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/wildebeest_herd/wildebeest_herd_optimization.py +0 -0
  257. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/wind_driven/__init__.py +0 -0
  258. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/wind_driven/models.py +0 -0
  259. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/wind_driven/wind_driven_optimization.py +0 -0
  260. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/zebra/__init__.py +0 -0
  261. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/zebra/models.py +0 -0
  262. {pyvolutionary-2.4.2 → pyvolutionary-2.5.1}/pyvolutionary/zebra/zebra_optimization.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyVolutionary
3
- Version: 2.4.2
3
+ Version: 2.5.1
4
4
  Summary: pyVolutionary is a package collecting metaheuristic algorithms, available for free usage and able to solve a wide range of optimization problems.
5
5
  Home-page: https://github.com/matteocacciola/pyvolutionary
6
6
  License: MIT
7
7
  Author: Matteo Cacciola
8
8
  Author-email: matteo.cacciola@gmail.com
9
- Requires-Python: >=3.10,<3.13
9
+ Requires-Python: >=3.10
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 3
@@ -14,13 +14,10 @@ Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Topic :: Scientific/Engineering
16
16
  Classifier: Topic :: Software Development
17
- Requires-Dist: matplotlib (>=3.8.1,<4.0.0)
18
- Requires-Dist: numpy (>=1.26.1,<2.0.0)
19
- Requires-Dist: opfunu (>=1.0.1,<2.0.0)
17
+ Requires-Dist: numpy (>=2.1.1,<3.0.0)
20
18
  Requires-Dist: pandas (>=2.2.0,<3.0.0)
21
- Requires-Dist: pydantic (>=2.4.2,<3.0.0)
19
+ Requires-Dist: pydantic (>=2.9.0,<3.0.0)
22
20
  Requires-Dist: scipy (>=1.12.0,<2.0.0)
23
- Requires-Dist: sphynx (>=0.0.3,<0.0.4)
24
21
  Project-URL: Repository, https://github.com/matteocacciola/pyvolutionary
25
22
  Description-Content-Type: text/markdown
26
23
 
@@ -519,15 +516,15 @@ Once you created your new classes, you can run the algorithm by calling the `opt
519
516
  ## Utilities
520
517
  **pyVolutionary** provides a set of utilities to facilitate the use of the library.
521
518
 
522
- ### GridSearchCV Hyper-parameter tuning
523
- **pyVolutionary** provides a `GridSearchCV` class to perform hyperparameter tuning of a model. The class is similar to
524
- the one provided by [scikit-learn](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html),
525
- but it uses the algorithms implemented in the library to perform the search. The class can be used as follows:
519
+ ### HyperTuner Hyper-parameter tuning
520
+ **pyVolutionary** provides a `HyperTuner` class to perform hyperparameter tuning of a model, by means of the algorithms
521
+ implemented in the library. The class can be used to replace the `GridSearchCV` of
522
+ [scikit-learn](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html):
526
523
 
527
524
  ```python
528
525
  from opfunu.cec_based.cec2017 import F52017
529
526
 
530
- from pyvolutionary import ContinuousMultiVariable, Task, BiogeographyBasedOptimization, GridSearchCV
527
+ from pyvolutionary import ContinuousMultiVariable, Task, BiogeographyBasedOptimization, HyperTuner
531
528
 
532
529
  f1 = F52017(30, f_bias=0)
533
530
 
@@ -550,9 +547,8 @@ params_bbo_grid = {
550
547
  "p_m": [0.01, 0.02, 0.05]
551
548
  }
552
549
 
553
-
554
550
  model = BiogeographyBasedOptimization()
555
- tuner = GridSearchCV(model, params_bbo_grid)
551
+ tuner = HyperTuner(model, params_bbo_grid)
556
552
 
557
553
  tuner.execute(task=task)
558
554
 
@@ -493,15 +493,15 @@ Once you created your new classes, you can run the algorithm by calling the `opt
493
493
  ## Utilities
494
494
  **pyVolutionary** provides a set of utilities to facilitate the use of the library.
495
495
 
496
- ### GridSearchCV Hyper-parameter tuning
497
- **pyVolutionary** provides a `GridSearchCV` class to perform hyperparameter tuning of a model. The class is similar to
498
- the one provided by [scikit-learn](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html),
499
- but it uses the algorithms implemented in the library to perform the search. The class can be used as follows:
496
+ ### HyperTuner Hyper-parameter tuning
497
+ **pyVolutionary** provides a `HyperTuner` class to perform hyperparameter tuning of a model, by means of the algorithms
498
+ implemented in the library. The class can be used to replace the `GridSearchCV` of
499
+ [scikit-learn](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html):
500
500
 
501
501
  ```python
502
502
  from opfunu.cec_based.cec2017 import F52017
503
503
 
504
- from pyvolutionary import ContinuousMultiVariable, Task, BiogeographyBasedOptimization, GridSearchCV
504
+ from pyvolutionary import ContinuousMultiVariable, Task, BiogeographyBasedOptimization, HyperTuner
505
505
 
506
506
  f1 = F52017(30, f_bias=0)
507
507
 
@@ -524,9 +524,8 @@ params_bbo_grid = {
524
524
  "p_m": [0.01, 0.02, 0.05]
525
525
  }
526
526
 
527
-
528
527
  model = BiogeographyBasedOptimization()
529
- tuner = GridSearchCV(model, params_bbo_grid)
528
+ tuner = HyperTuner(model, params_bbo_grid)
530
529
 
531
530
  tuner.execute(task=task)
532
531
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyVolutionary"
3
- version = "2.4.2"
3
+ version = "2.5.1"
4
4
  description = "pyVolutionary is a package collecting metaheuristic algorithms, available for free usage and able to solve a wide range of optimization problems."
5
5
  authors = ["Matteo Cacciola <matteo.cacciola@gmail.com>"]
6
6
  license = "MIT"
@@ -15,13 +15,10 @@ classifiers = [
15
15
 
16
16
 
17
17
  [tool.poetry.dependencies]
18
- python = ">=3.10,<3.13"
19
- pydantic = "^2.4.2"
20
- numpy = "^1.26.1"
21
- matplotlib = "^3.8.1"
22
- sphynx = "^0.0.3"
18
+ python = ">=3.10"
19
+ pydantic = "^2.9.0"
20
+ numpy = "^2.1.1"
23
21
  pandas = "^2.2.0"
24
- opfunu = "^1.0.1"
25
22
  scipy = "^1.12.0"
26
23
 
27
24
 
@@ -39,6 +36,15 @@ sphinx = "^7.2.6"
39
36
  sphinx-rtd-theme = "^1.3.0"
40
37
  myst-parser = "^2.0.0"
41
38
 
39
+
40
+ [tool.poetry.group.demo.dependencies]
41
+ matplotlib = "^3.7.5"
42
+
43
+
44
+ [tool.poetry.group.examples.dependencies]
45
+ opfunu = "^1.0.1"
46
+
47
+
42
48
  [build-system]
43
49
  requires = ["poetry-core"]
44
50
  build-backend = "poetry.core.masonry.api"
@@ -80,21 +80,22 @@ from .whales import *
80
80
  from .wildebeest_herd import *
81
81
  from .wind_driven import *
82
82
  from .zebra import *
83
- from .gridsearchcv import GridSearchCV
83
+ from .hypertuner import HyperTuner
84
84
  from .enums import TaskType
85
85
  from .multitask import Multitask
86
86
  from .models import (
87
+ Agent,
88
+ EarlyStopping,
87
89
  OptimizationResult,
88
90
  Population,
89
- Agent,
90
91
  Task,
92
+ BinaryVariable,
91
93
  ContinuousVariable,
92
94
  ContinuousMultiVariable,
93
95
  DiscreteVariable,
94
96
  DiscreteMultiVariable,
95
- PermutationVariable,
96
97
  MultiObjectiveVariable,
97
- BinaryVariable,
98
+ PermutationVariable,
98
99
  )
99
100
  from .helpers import best_agent, worst_agent, best_agents, worst_agents, special_agents, get_levy_flight_step
100
101
  from .utils import agent_trend, best_agent_trend, agent_position, best_agent_position
@@ -36,6 +36,8 @@ class OptimizationAbstract(ABC, Generic[T]):
36
36
  self._best_agent: T | None = None
37
37
  self._worst_agent: T | None = None
38
38
  self._current_cycle = 1
39
+ self._errors = []
40
+ self._error_diffs = []
39
41
 
40
42
  @abstractmethod
41
43
  def optimization_step(self):
@@ -228,7 +230,6 @@ class OptimizationAbstract(ABC, Generic[T]):
228
230
 
229
231
  self.after_initialization()
230
232
 
231
- errors: list[float] = []
232
233
  while True:
233
234
  self.optimization_step()
234
235
  # append the current population to the evolution, being sure that costs and fitness are updated
@@ -237,8 +238,7 @@ class OptimizationAbstract(ABC, Generic[T]):
237
238
  (self._best_agent, ), (self._worst_agent, ) = special_agents(self._population, n_best=1, n_worst=1)
238
239
 
239
240
  # stop when the error is below the error criteria or when the maximum number of cycles is reached
240
- error, fitness, has_to_stop = self.__should_stop__()
241
- errors.append(error)
241
+ error, fitness, has_to_stop = self.__error_check__()
242
242
  if self._debug:
243
243
  print(f"Cycle {self._current_cycle} - Best position {self._best_agent.position}, "
244
244
  f"cost {self._best_agent.cost if task.minmax == TaskType.MIN else -self._best_agent.cost} - "
@@ -253,10 +253,10 @@ class OptimizationAbstract(ABC, Generic[T]):
253
253
  f"Error criteria reached - Fitness error: {error}")
254
254
 
255
255
  return OptimizationResult(
256
- evolution=evolution, rates=errors, best_solution=self._best_agent, task_type=task.minmax
256
+ evolution=evolution, rates=self._errors, best_solution=self._best_agent, task_type=task.minmax
257
257
  )
258
258
 
259
- def __should_stop__(self) -> tuple[float, float, bool]:
259
+ def __error_check__(self) -> tuple[float, float, bool]:
260
260
  """
261
261
  Check whether the optimization algorithm has to stop or not based on the error criteria and the current cycle.
262
262
  :return: a tuple containing the current error, the average fitness and a boolean indicating whether the
@@ -264,15 +264,36 @@ class OptimizationAbstract(ABC, Generic[T]):
264
264
  :rtype: tuple[float, float, bool]
265
265
  """
266
266
  # Get the optimal population
267
- fitness_error = self._config.fitness_error
268
267
  avg_fit = average_fitness(self._population)
269
- cycle = self._current_cycle
268
+ current_error = abs(1 - avg_fit)
269
+ previous_error = self._errors[-1] if len(self._errors) > 0 else 0
270
+
271
+ # Append the current error to the list of errors
272
+ self._errors.append(current_error)
273
+
274
+ # Append the difference between the current error and the previous one to the list of error differences
275
+ self._error_diffs.append(current_error - previous_error)
276
+
277
+ return current_error, avg_fit, self.__should_stop__(current_error)
278
+
279
+ def __should_stop__(self, current_error: float) -> bool:
280
+ fitness_error = self._config.fitness_error
270
281
  max_cycles = self._config.max_cycles
282
+ early_stopping = self._config.early_stopping
271
283
 
272
- current_error = abs(1 - avg_fit)
284
+ cycle = self._current_cycle
285
+
286
+ # Stop when the maximum number of cycles is reached
287
+ has_to_stop = cycle >= max_cycles
288
+
289
+ # Evaluate the early stopping criteria
290
+ if early_stopping is not None:
291
+ min_delta, patience = early_stopping.min_delta, early_stopping.patience
292
+ print(min_delta, patience, self._error_diffs[-patience:])
293
+ has_to_stop |= all([diff < 0 and abs(diff) < min_delta for diff in self._error_diffs[-patience:]])
273
294
 
274
- # Stop when the error is below the error criteria or when the maximum number of cycles is reached
275
- if fitness_error is None:
276
- return current_error, avg_fit, cycle >= max_cycles
295
+ # Stop when the error is below the error criteria
296
+ if fitness_error is not None:
297
+ has_to_stop |= current_error <= fitness_error
277
298
 
278
- return current_error, avg_fit, current_error <= fitness_error or cycle >= max_cycles
299
+ return has_to_stop
@@ -25,7 +25,7 @@ class ParameterGrid:
25
25
 
26
26
  Parameters
27
27
  ----------
28
- param_grid : dict of str to sequence, or sequence of such
28
+ param_grid: dict of str to sequence, or sequence of such
29
29
  The parameter grid to explore, as a dictionary mapping estimator
30
30
  parameters to sequences of allowed values.
31
31
 
@@ -37,8 +37,7 @@ class ParameterGrid:
37
37
 
38
38
  See Also
39
39
  --------
40
- GridSearchCV : Uses :class:`ParameterGrid` to perform a full parallelized
41
- parameter search.
40
+ HyperTuner: Uses :class:`ParameterGrid` to perform a full parallelized parameter search.
42
41
  """
43
42
 
44
43
  def __init__(self, param_grid):
@@ -148,9 +147,9 @@ class ParameterGrid:
148
147
  raise IndexError("ParameterGrid index out of range")
149
148
 
150
149
 
151
- class GridSearchCV:
150
+ class HyperTuner:
152
151
  """
153
- GridSearchCV utility.
152
+ HyperTuner utility.
154
153
 
155
154
  This is a feature that enables the tuning of hyperparameters for an algorithm.
156
155
  It also supports exporting results in various formats, such as Pandas DataFrame, JSON, and CSV.
@@ -68,10 +68,22 @@ class LabelEncoder:
68
68
  return [self.__unique_labels__[i] if i in self.__label_to_index__.values() else "unknown" for i in y]
69
69
 
70
70
 
71
+ class EarlyStopping(BaseModel):
72
+ patience: int | None = 1
73
+ min_delta: float | None = 1e-4
74
+
75
+ @field_validator("patience")
76
+ def validate_patience(cls, v):
77
+ if v is not None and v < 1:
78
+ raise ValueError(f"\"patience\" must be greater than or equal to one. Got {v}")
79
+ return v
80
+
81
+
71
82
  class BaseOptimizationConfig(BaseModel):
72
83
  population_size: int
73
84
  fitness_error: float | None = 0.1
74
85
  max_cycles: int
86
+ early_stopping: EarlyStopping | None = None
75
87
 
76
88
 
77
89
  class Agent(BaseModel):
@@ -1,64 +1,5 @@
1
- import os
2
- import numpy as np
3
- from matplotlib import pyplot as plt, animation
4
-
5
1
  from .helpers import sort_by_cost
6
- from .models import OptimizationResult, Population
7
-
8
-
9
- def plot(
10
- fitness_function: callable,
11
- pos_min: float,
12
- pos_max: float,
13
- evolution: list[Population],
14
- ):
15
- # Plotting preparation
16
- x = np.linspace(pos_min, pos_max, 80)
17
- y = np.linspace(pos_min, pos_max, 80)
18
- X, Y = np.meshgrid(x, y)
19
- Z = fitness_function([X, Y])
20
-
21
- # Plot the surface.
22
- # fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
23
- # ax.plot_surface(X, Y, Z, cmap=cm.coolwarm, linewidth=0, antialiased=False)
24
- # Plot the wireframe
25
- fig = plt.figure(figsize=(10, 10))
26
- ax = fig.add_subplot(111, projection='3d')
27
- ax.plot_wireframe(X, Y, Z, color='r', linewidth=0.2)
28
- ax.set_xlabel('x')
29
- ax.set_ylabel('y')
30
- ax.set_zlabel('z')
31
-
32
- # Animation image placeholder
33
- images = []
34
-
35
- # Add plot for each generation
36
- for generation in evolution:
37
- x = np.zeros(len(generation.agents))
38
- y = np.zeros(len(generation.agents))
39
- z = np.zeros(len(generation.agents))
40
- for i, agent in enumerate(generation.agents):
41
- x[i], y[i] = agent.position
42
- z[i] = agent.cost
43
- image = ax.scatter3D(x, y, z, c='b')
44
- images.append([image])
45
-
46
- return fig, images
47
-
48
-
49
- def animate(
50
- fitness_function: callable,
51
- optimization_result: OptimizationResult,
52
- pos_min: float,
53
- pos_max: float,
54
- filename: str
55
- ):
56
- current_dir = os.path.dirname(os.path.abspath(__file__))
57
-
58
- # Generate and save the animation image
59
- figure, images = plot(fitness_function, pos_min, pos_max, optimization_result.evolution)
60
- animated_image = animation.ArtistAnimation(figure, images)
61
- animated_image.save(os.path.join(current_dir, "..", filename), writer='pillow')
2
+ from .models import OptimizationResult
62
3
 
63
4
 
64
5
  def agent_trend(result: OptimizationResult, idx: int, iters: list[int] | None = None) -> list[float]: