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

Overflow error encountered in Matrixfactorization and SVDPlusPlus #38

Closed
srijang97 opened this issue Feb 27, 2020 · 1 comment
Closed

Comments

@srijang97
Copy link

srijang97 commented Feb 27, 2020

Hi. I am trying out different recommendation algorithms with random hyperparameters. Both MatrixFactorization and SVDPlusPlus produce the following errors:

C:\Users\guptasr\AppData\Local\Continuum\anaconda3\envs\fyp2\lib\site-packages\caserec\recommenders\rating_prediction\matrixfactorization.py:146: RuntimeWarning: overflow encountered in double_scalars
  error_final += (eui ** 2.0)

C:\Users\guptasr\AppData\Local\Continuum\anaconda3\envs\fyp2\lib\site-packages\caserec\recommenders\rating_prediction\matrixfactorization.py:153: RuntimeWarning: overflow encountered in multiply
  delta_u = np.subtract(np.multiply(eui, i_f), np.multiply(self.delta, u_f))

C:\Users\guptasr\AppData\Local\Continuum\anaconda3\envs\fyp2\lib\site-packages\caserec\recommenders\rating_prediction\matrixfactorization.py:154: RuntimeWarning: overflow encountered in multiply
  delta_i = np.subtract(np.multiply(eui, u_f), np.multiply(self.delta, i_f))

C:\Users\guptasr\AppData\Local\Continuum\anaconda3\envs\fyp2\lib\site-packages\caserec\recommenders\rating_prediction\matrixfactorization.py:157: RuntimeWarning: invalid value encountered in add
  self.p[user] += np.multiply(self.learn_rate, delta_u)

C:\Users\guptasr\AppData\Local\Continuum\anaconda3\envs\fyp2\lib\site-packages\caserec\recommenders\rating_prediction\matrixfactorization.py:158: RuntimeWarning: invalid value encountered in add
  self.q[item] += np.multiply(self.learn_rate, delta_i)

The dataset is as follows:
train data:: 1890 users and 16551 items (83550 interactions) | sparsity:: 99.73%
test data:: 1864 users and 3973 items (9284 interactions) | sparsity:: 99.87%

The input parameters to the MatrixFactorization class for this run were:
'mf_delta': 0.08706786244826163, 'mf_epochs': 19.0, 'mf_factors': 190.0, 'mf_learn_rate': 0.09982193107968043

By removing the learn_rate and delta input parameters, the error goes away!!

Also, using the same configuration on a different dataset (Movielens100K) did not produce any error.
train data:: 610 users and 9003 items (80668 interactions) | sparsity:: 98.53%
test data:: 610 users and 5089 items (20168 interactions) | sparsity:: 99.35%

Kindly advise on how to solve this issue!!

@srijang97
Copy link
Author

Issue resolved after changing the feedback range to [0, 5]

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

1 participant