Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
poty
Jun 21, 2008

虹はどこで終わるのですか? あなたの魂の中で、または地平線で?
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

Adbot
ADBOT LOVES YOU

poty
Jun 21, 2008

虹はどこで終わるのですか? あなたの魂の中で、または地平線で?

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply