Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OverflowError: n_iter too high in bpr.FMRecommender #147

Open
rhjohnstone opened this issue Dec 6, 2018 · 1 comment
Open

OverflowError: n_iter too high in bpr.FMRecommender #147

rhjohnstone opened this issue Dec 6, 2018 · 1 comment

Comments

@rhjohnstone
Copy link

When I try to set a massive number of iterations, e.g.

fm = bpr.FMRecommender(n_iter=10000000000000, init_stdev=0.1, step_size=0.01, rank=10, random_state=123)
fm.fit(X, compares)

I get as an error (which occurs when the fit method is called):

OverflowError: value too large to convert to int

I also tried calling the fit method twice with n_iter=100 to see if I could train in batches, but found the output was the same after the first 100 as after the second 100, so I suppose fit also resets everything?

Is the maximum possible n_iter related to the size of the training data?

And is there any way to continue training the bpr.FMRecommender after n_iter iterations have been performed?

@ibayer
Copy link
Owner

ibayer commented Dec 6, 2018

Is the maximum possible n_iter related to the size of the training data?

No, n_iter is really the number of individual sgd updates (not epoch). This is indeed the reason why even fairly large n_iter might result in very few passes over the training data if you have a lot of samples.

so I suppose fit also resets everything?

This is indeed true, some solver support fit(X,y, warm_start=Ture) but the sgd solver doesn't.

And is there any way to continue training the bpr.FMRecommender after n_iter iterations have been performed?

No, see above.

A new BPR / SGD implementation is on it's way to solve this issues but it might take a while till we have it ready for release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants