KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have been working on latent semantic analysis lately. I have implemented it in java by making use of the Jama package. Here is the code: Matrix vtranspose ; a = new Matrix(termdoc); termdoc = a.getArray(); a = a.transpose() ; SingularValueDecomposition sv =new SingularValueDecomposition(a) ; u = sv.getU(); v = sv.getV(); s = sv.getS(); vtranspose = v.transpose() ; // we obtain this as a result of svd uarray = u.getArray(); sarray = s.getArray(); varray = vtranspose.getArray(); if(semantics.maketerms.nodoc>50) { sarray_mod = new double[50][50]; uarray_mod = new double[uarray.length][50]; varray_mod = new double[50][varray.length]; move(sarray,50,50,sarray_mod); move(uarray,uarray.length,50,uarray_mod); move(varray,50,varray.length,varray_mod); e = new Matrix(uarray_mod); f = new Matrix(sarray_mod); g = new Matrix(varray_mod); Matrix temp =e.times(f); result = temp.times(g); } else { Matrix temp = u.times(s); result = temp.times(vtranspose); } result = result.transpose(); results = result.getArray() ; return results ; But how do we determine the number of dimensions? Is there a method to determine the number of dimensions to which the system should be reduced to obtain best results? What other parameters do we consider for effective performance of LSA?
Tags (comma-separated)
Save Edits
Cancel