Examples of Cooccurrence


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

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);
    if (Double.isNaN(expectedSimilarity)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.