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.
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: The transformed matrix:
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