Closed MilesCranmer closed 11 months ago
I guess it might be cleaner to just have the model not throw an error, but just return an uninitialized array in case of error?
Hi,
There are some parts of search space where my model will fail to return a usable result, and this triggers a
BoundError
at the prediction step. The parts of search space where this will occur is not clearly defined (and is probabilistic), soclean!
is not applicable. I am wondering how I may wrap the tuning with atry-catch
so that certain errors are simply returned as an infinite loss, rather than breaking the entire tuning and exiting?Thanks! Miles
Can you give an example code snippet.
I guess it might be cleaner to just have the model not throw an error, but just return an uninitialized array in case of error?
Yeah. You should be able to handle all that during the call to fit.
Thanks for the quick response!
After thinking about it more, I may just have the predict
step return an uninitialized array in case of incorrect fits, as it seems something unique to SRRegressor (in case the search can't find a valid expression, for example).
Hi,
There are some parts of search space where my model will fail to return a usable result, and this triggers a
BoundError
at the prediction step. The parts of search space where this will occur is not clearly defined (and is probabilistic), soclean!
is not applicable. I am wondering how I may wrap the tuning with atry-catch
so that certain errors are simply returned as an infinite loss, rather than breaking the entire tuning and exiting?Thanks! Miles