-
Notifications
You must be signed in to change notification settings - Fork 693
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
CSCMatrix result raise a ArrayIndexOutOfBoundsException #589
Comments
can you possibly give me a snippet that reproduces? On Wed, Sep 28, 2016 at 4:45 AM, Alejandro Alcalde <notifications@github.com
|
Of course, I have added a print statement: val tempFeatures = new CSCMatrix.Builder[Boolean](rows = 28, cols = 513)
trainX.zipWithIndex foreach {
case ((_, vec), index) => vec foreach (int => {
println(s"$index, $int")
tempFeatures add(index,int, true)
})
}
features getOrElseUpdate (lp, tempFeatures.result()) The result of the print statement:
And the stacktrace:
|
heh, finally looked at this. You were giving it columns greater than what you said the max was. the failure was non obvious so I'm adding a better error message. |
Thanks!
On Wed, Jan 4, 2017, 07:16 David Hall ***@***.***> wrote:
Closed #589 <#589> via 8f36cb7
<8f36cb7>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#589 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAYGLaSbIMOBubOzj31JBdqnXMp2PaM-ks5rOzlagaJpZM4KIuLM>
.
--
Alejandro Alcalde - elbauldelprogramador.com
|
Hi, I posted a question on stackoverflow for this, but may be this is a proper place.
I am working with a sparse matrix (
CSCMatrix
) in scala using Breeze. After creating and filling the matrix:When I call
tempFeatures.result()
, as said in its documentation I am getting anArrayIndexOutOfBoundsException
:The size of my Sparse matrix is
28x513
, so the exception make sense. But I have no control on the methodresult()
. Is there a way I could fix this?The only thing related to this error I've found is this issue in Breeze github
Looking at the Breeze code, it seems that the exception its happening here:
I am debugging to try to catch the bug, but it seems the problem is that my column size is 513, but internally that while loop is checking if lastCol (512) is less that col (516), That is the reason of the problem. May be one way to solve it is replacing the while with:
And then pad the rest of the array until
col
?The text was updated successfully, but these errors were encountered: