Package org.apache.mahout.math.hadoop.similarity

Examples of org.apache.mahout.math.hadoop.similarity.Cooccurrence


    Collection<Cooccurrence> cooccurrences = new LinkedList<Cooccurrence>();
    for (int n = 0; n < numberOfColumns; n++) {
      double valueA = v1.get(n);
      double valueB = v2.get(n);
      if (valueA != 0.0 && valueB != 0.0) {
        cooccurrences.add(new Cooccurrence(n, valueA, valueB));
      }
    }

    double result = similarity.similarity(rowA, rowB, cooccurrences, weightA, weightB, numberOfColumns);
    assertEquals(expectedSimilarity, result, EPSILON);
View Full Code Here


    Collection<Cooccurrence> cooccurrences = new LinkedList<Cooccurrence>();
    for (int n = 0; n < numberOfColumns; n++) {
      double valueA = v1.get(n);
      double valueB = v2.get(n);
      if (valueA != 0.0 && valueB != 0.0) {
        cooccurrences.add(new Cooccurrence(n, valueA, valueB));
      }
    }

    double result = similarity.similarity(rowA, rowB, cooccurrences, weightA, weightB, numberOfColumns);
    if (Double.isNaN(expectedSimilarity)) {
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.hadoop.similarity.Cooccurrence

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.