Package org.apache.mahout.math

Examples of org.apache.mahout.math.DiagonalMatrix


    for (Preference pref : prefs) {
      long itemId = pref.getItemID();
      int itemIdx = itemIndex(itemId);
      confidenceMatrix.setQuick(itemIdx, itemIdx, 1);
    }
    return new DiagonalMatrix(confidenceMatrix);
  }
View Full Code Here


  private Matrix ones(int size) {
    double[] vector = new double[size];
    for (int i = 0; i < size; i++) {
      vector[i] = 1;
    }
    Matrix ones = new DiagonalMatrix(vector);
    return ones;
  }
View Full Code Here

        return fileName.matches("V-.*");
      }
    })));

    // The values in A are pretty big so this is a pretty tight relative tolerance
    assertEquals(0, A.minus(u.times(new DiagonalMatrix(s.getSingularValues())).times(v.transpose())).aggregate(Functions.PLUS, Functions.ABS), 1.0e-7);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.DiagonalMatrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.