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
MLARAM bug " return numpy.array(numpy.matrix(allranks))" raises ValueError: matrix must be 2-dimensional #68
Comments
Hello, |
Yes, please do. If there is something off we can review your work. It can always be improved in the remote branch. We then approve your request if everything's good and we tested that it works as intented. |
i've merged your PRs but it seems that the todense() approach still fails, mostly because neuron vectors become matrices instead of arrays if todense() is used. @simon-m which representation is the best for a neuron's vector? array, matrix or sparse matrix? |
Well, so far the code seems to rely on operations that cannot be applied to sparse matrices. This PR only adds some todense() where needed to avoid crashes. Thus, until the code is rewritten in a way sparse matrices can be processed, sparse matrices are probably not suited. From what I see, there is a great deal of Cheers |
@simon-m, ok so I went that way, using arrays internally for now if dense representation is passed. this is fixed in master. |
Hello, I am trying to use the classifier with a dense matrix (n_samples, n_features) that was converted from a Pandas DataFrame. I tried to use several functions such as "DataFrame.values" and "numpy.matrix(DataFrame)" with no success. The classifier raises the error "ValueError: matrix must be 2-dimensional". |
I forgot to say that I can actually train the classifier using a DataFrame converted using "numpy.matrix(DataFrame)" but it does not work when it comes to predict a test matrix |
Hello,
when running the following code, I get the error mentioned in the title:
Full traceback:
Also, note that MLARAM does not support sparse matrices contrary to what is mentioned in the comments. As an aside, in the same method, the test
fails on sparse matrices and should probably be replaced by something like
regards,
Simon
The text was updated successfully, but these errors were encountered: