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

Matrix Transformation produces strange Floatingpoint values with commas #53

Open
LauraS2 opened this issue Jun 23, 2014 · 0 comments
Open

Comments

@LauraS2
Copy link

LauraS2 commented Jun 23, 2014

Dear Developers,

I'm using a library that calls edu.ucla.sspace.matrix.SVD.svd(File matrix, Algorithm alg, Format format, int dimensions) to perform a SVD.
However, during the execution a java.lang.NumberFormatException occurs on the String "0,273696". Obviously, the comma is causing the problem. But how the comma comes to exist in the first place is unclear to me. The algorithm to use is ANY.

The error:
Exception in thread "main" java.lang.NumberFormatException: For input string: "0,273696"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1241)
at java.lang.Double.parseDouble(Double.java:540)
at edu.ucla.sspace.matrix.MatrixIO.readMatlabSparse(MatrixIO.java:1136)
at edu.ucla.sspace.matrix.MatrixIO.readMatrix(MatrixIO.java:798)
at edu.ucla.sspace.matrix.MatrixIO.readMatrix(MatrixIO.java:723)
at edu.ucla.sspace.matrix.MatrixIO.readMatrixArray(MatrixIO.java:697)
at edu.ucla.sspace.matrix.SVD.svd(SVD.java:426)
at edu.ucla.sspace.matrix.SVD.svd(SVD.java:430)
...

So far I was able to trace the origin of the error to the transformation of a matrix. The matrix itself looks fine. But the transformed variant suddenly contains floatingpoint values with commas instead of points.

The normal matrix:
matrix
The transformed matrix:
transformedmatrix

The Transformation is called in this fashion:

import edu.ucla.sspace.matrix.Transform;
...
Transform transform = new LogEntropyTransform();
File transformedMatrix = transform.transform(termDocumentMatrix,
termDocumentMatrixBuilder.getMatrixFormat());

I hope you can help me.

Yours,
Laura

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