|
I'm currently working on "babby's first ML project" for a school assignment about setting up an SVM classifier to guess if a stock will go up the next day. It does this from a handful of features I came up with (that obviously can't predict that) using sklearn on Python. The thing that frustrates me about sklearn is that I don't know how to guess whether a model fitting (as part of a RandomizedSearchCV for example) is going to take 5 seconds, or 5 minutes, or seemingly infinite time. I wish you could set some sort of timeout value like "if this set of parameters hasn't finished the fitting process in 5 seconds just kill it" but it doesn't look like that exists. poty fucked around with this message at 18:26 on Jun 3, 2023 |
# ¿ Jun 3, 2023 18:22 |
|
|
# ¿ May 17, 2024 01:20 |
|
CarForumPoster posted:You can create watchdog timers in Python, then run .fit() inside them. Thanks for the suggestion, but I don't think it works if I understand things correctly. There is only one call to .fit() for the whole RandomizedSearchCV optimization process, as opposed to one call to .fit() for each of the 100 sets of parameters (5 of which might never complete). I can put the global .fit() call inside a timer but then I don't get results for any set of parameters if one is slow (it's the same result as what I'm doing now, killing the kernel in Jupyter Notebook). I guess the solution is to evaluate the sets of parameters "manually" without using something like RandomizedSearchCV or GridSearchCV, then I would in fact have access to the individual .fit() calls and could do that.
|
# ¿ Jun 3, 2023 23:55 |