for(String feature : features) {
featureIndex.put(feature, featureNo);
featureNo++;
}
System.out.println("Indexed...");
SVDHarness svdh = new SVDHarness(termNo, featureNo);
for(int i=0;i<termNo;i++) {
Map<String,Double> wv = se.getWeightVector(terms.get(i));
for(String feature : wv.keySet()) {
int fno = featureIndex.get(feature);
svdh.set(fno, i, wv.get(feature));
}
}
System.out.println("Harness ready...");
svdh.svd(10);
Matrix lm = svdh.getUt().transpose();
System.out.println(lm.getRowDimension());
System.out.println(lm.getColumnDimension());
System.out.println(termNo);
System.out.println(featureNo);
double [] svals = svdh.getS();
if(true) {
for(int i=0;i<svals.length;i++) {
System.out.println(svals[i]);
for(int j=0;j<lm.getRowDimension();j++) {
lm.set(j, i, lm.get(j, i) * svals[i]);