Examples of times()


Examples of org.apache.mahout.math.Vector.times()

      s1 = point.clone();
    } else {
      s1 = s1.plus(wtPt);
    }
    if (s2 == null) {
      s2 = wtPt.times(wtPt);
    } else {
      s2 = s2.plus(wtPt.times(wtPt));
    }
  }
 
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

      s1 = s1.plus(wtPt);
    }
    if (s2 == null) {
      s2 = wtPt.times(wtPt);
    } else {
      s2 = s2.plus(wtPt.times(wtPt));
    }
  }
 
  /** Compute a "standard deviation" value to use as the "radius" of the cluster for display purposes */
  public double std() {
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

 
  /** Compute a "standard deviation" value to use as the "radius" of the cluster for display purposes */
  public double std() {
    if (s0 > 0) {
      Vector radical = s2.times(s0).minus(s1.times(s1));
      radical = radical.times(radical).assign(new SquareRootFunction());
      Vector stds = radical.assign(new SquareRootFunction()).divide(s0);
      return stds.zSum() / stds.size();
    } else {
      return 0;
    }
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

      mean = x.like();
      delta = x.clone();
    }
    mean = mean.plus(delta.divide(n));
    if (m2 != null) {
      m2 = m2.plus(delta.times(x.minus(mean)));
    } else {
      m2 = delta.times(x.minus(mean));
    }
    variance = m2.divide(n - 1);
  }
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

    }
    mean = mean.plus(delta.divide(n));
    if (m2 != null) {
      m2 = m2.plus(delta.times(x.minus(mean)));
    } else {
      m2 = delta.times(x.minus(mean));
    }
    variance = m2.divide(n - 1);
  }

  @Override
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

      blckCnt++;
      cnt = 0;
    }

    for (int i = 0; i < n; i++) {
      btEmitter.emitRow(i, qRowV.times(aRow.getQuick(i)));
    }

  }

View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

    for (Map.Entry<Integer, Vector> btRowEntry : btRows.entrySet()) {
      Vector btRow = btRowEntry.getValue();
      assert btRow.size() == kp;
      for (int i = 0; i < kp; i++) {
        bbtEmitter.emitRow(i, btRow.times(btRow.getQuick(i)));
      }
    }

    double[][] bbtValues = new double[kp][];
    for (int i = 0; i < kp; i++) {
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

    for (Map.Entry<Integer, Vector> btRowEntry : btRows.entrySet()) {
      Vector btRow = btRowEntry.getValue();
      assert btRow.size() == kp;
      for (int i = 0; i < kp; i++) {
        bbtEmitter.emitRow(i, btRow.times(btRow.getQuick(i)));
      }
    }

    double[][] bbtValues = new double[kp][];
    for (int i = 0; i < kp; i++) {
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

        int itemIDIndex = usedItemsIterator.next().index();
        numberOfSimilarItemsUsed.setQuick(itemIDIndex, numberOfSimilarItemsUsed.getQuick(itemIDIndex) + 1);
      }

      numerators = numerators == null
          ? prefValue == BOOLEAN_PREF_VALUE ? simColumn.clone() : simColumn.times(prefValue)
          : numerators.plus(prefValue == BOOLEAN_PREF_VALUE ? simColumn : simColumn.times(prefValue));

      simColumn.assign(ABSOLUTE_VALUES);
      denominators = denominators == null ? simColumn : denominators.plus(simColumn);
    }
View Full Code Here

Examples of org.apache.mahout.math.Vector.times()

        numberOfSimilarItemsUsed.setQuick(itemIDIndex, numberOfSimilarItemsUsed.getQuick(itemIDIndex) + 1);
      }

      numerators = numerators == null
          ? prefValue == BOOLEAN_PREF_VALUE ? simColumn.clone() : simColumn.times(prefValue)
          : numerators.plus(prefValue == BOOLEAN_PREF_VALUE ? simColumn : simColumn.times(prefValue));

      simColumn.assign(ABSOLUTE_VALUES);
      denominators = denominators == null ? simColumn : denominators.plus(simColumn);
    }
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.