Closed windowshopr closed 2 years ago
Hi @windowshopr thanks for your message, I'm glad you are enjoying the package! This seems like a nice feature, I'll look for in more detail how to implement it
Greetings
Thanks! I think it would be a cool feature to add I think! Psedo-ish code might look something like:
try:
while True:
# All the training stuff here
except KeyboardInterrupt:
# Return the best model here/perform any final steps in the .fit() function
print('Manually stopped training!')
Yea, I see that in TPOT, I'll look further how to get this like callback or something that doesn't requires a big try/except block, thanks for the tip!
Hi @windowshopr, this is now implemented in PR #86.
Training gracefully stops if interrupted by some of these exceptions: KeyboardInterrupt
(ctrl+c), SystemExit
, StopIteration
.
When one of these exceptions is raised, the model finishes the current generation and saves the current best model. It only works if at least one generation has been completed.
Awesome! Thanks!!!
Is your feature request related to a problem? Please describe. Nope.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] None.
What is the use case for this feature? When a user wants to stop the optimization process manually (without using a callback), they could press CTRL + C to stop. The best evolved_estimator at the time of pressing CTRL + C will be returned and optimization will stop, allowing the rest of the script to continue.
Describe the solution you'd expect See above
A clear and concise description of what you want to happen. TPOT is a good reference for this. The user presses CTRL + C after at least 1 pipeline has been fitted, and the best pipeline found until that point is used. The rest of the script can continue after that, like the evolved_estimator.predict() function.
Describe the workflow you want to enable See above.
Additional context Love the tool! Would be cool to see this implemented :D