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

java.lang.IllegalArgumentException: dimensions must be positive when running lsa #80

Open
uacy opened this issue Aug 28, 2017 · 0 comments

Comments

@uacy
Copy link

uacy commented Aug 28, 2017

When I try to run this code:

public LSA() throws IOException {
int noOfFiles = 100;
File[] files = new File(corpusPath).
LatentSemanticAnalysis algo = new LatentSemanticAnalysis(10);

	for (int i = 0; i < noOfFiles; ++i) {
		in = new BufferedReader(new FileReader(files[i]));
		algo.processDocument(in);
	}
	algo.processSpace(System.getProperties()); <-- Here is where it crashes

}

I get this error:

Aug 28, 2017 9:07:17 PM edu.ucla.sspace.common.GenericTermDocumentVectorSpace processSpace
INFO: performing log-entropy transform
Aug 28, 2017 9:07:17 PM edu.ucla.sspace.matrix.LogEntropyTransform$LogEntropyGlobalTransform
INFO: Computing the total row counts
Aug 28, 2017 9:10:58 PM edu.ucla.sspace.matrix.LogEntropyTransform$LogEntropyGlobalTransform
INFO: Computing the entropy of each row
Aug 28, 2017 9:11:00 PM edu.ucla.sspace.matrix.LogEntropyTransform$LogEntropyGlobalTransform
INFO: Scaling the entropy of the rows
Aug 28, 2017 9:11:09 PM edu.ucla.sspace.lsa.LatentSemanticAnalysis processSpace
INFO: reducing to 10 dimensions
Exception in thread "main" java.lang.IllegalArgumentException: dimensions must be positive
at edu.ucla.sspace.matrix.OnDiskMatrix.(OnDiskMatrix.java:98)
at edu.ucla.sspace.matrix.Matrices.create(Matrices.java:216)
at edu.ucla.sspace.matrix.MatrixIO.readDenseTextMatrix(MatrixIO.java:927)
at edu.ucla.sspace.matrix.MatrixIO.readMatrix(MatrixIO.java:795)
at edu.ucla.sspace.matrix.MatrixIO.readMatrix(MatrixIO.java:762)
at edu.ucla.sspace.matrix.factorization.SingularValueDecompositionMatlab.factorize(SingularValueDecompositionMatlab.java:137)
at edu.ucla.sspace.lsa.LatentSemanticAnalysis.processSpace(LatentSemanticAnalysis.java:439)
at app.LSA.(LSA.java:37)
at app.AppMain.init(AppMain.java:60)
at app.AppMain.(AppMain.java:49)
at app.AppMain.main(AppMain.java:53)

I am not sure if I use the library wrong, but I don't see a problem in my code.

Could you help me with this?

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