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

Support dense matrices or convert to sparse instead of raising TypeError #97

Open
macks22 opened this issue May 1, 2017 · 1 comment
Labels

Comments

@macks22
Copy link
Contributor

macks22 commented May 1, 2017

When I try to fit als.FMClassifier with a dense numpy matrix, I get:

  File "/home/mack/anaconda2/lib/python2.7/site-packages/fastFM/als.py", line 175, in fit
    order="F")
  File "/home/mack/anaconda2/lib/python2.7/site-packages/fastFM/validation.py", line 29, in wrapper
    raise TypeError('A dense matrix was passed in, but sparse'
TypeError: A dense matrix was passed in, but sparsedata is required.

Any reason not to support dense matrices? I'm wondering if it's simply because the type of data an FM is well-suited for cannot generally be represented by a dense matrix. Seems like if the user can fit it into memory, then why not support it? If sparse matrices are absolutely required, is it reasonable to simply convert to a dense matrix instead of raising the TypeError?

@ibayer
Copy link
Owner

ibayer commented May 2, 2017

FMs can deal with dense matrices but I wouldn’t expect better performance then a straight forward second order polynomial regression/classification.

The fastFM solver are optimized for sparse matrices, converting a dense matrix is conceivable but only if we raise a warning. I consider the use of dense matrices with FMs an edge case and the user should be aware of this.

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

No branches or pull requests

2 participants