Package org.apache.mahout.matrix

Examples of org.apache.mahout.matrix.Vector.zSum()


    mean = s1.divide(s0);
    // compute the average of the component stds
    if (s0 > 1) {
      Vector std = s2.times(s0).minus(s1.times(s1)).assign(
          new SquareRootFunction()).divide(s0);
      stdDev = std.zSum() / s1.size();
    } else {
      stdDev = Double.MIN_VALUE;
    }
  }
View Full Code Here


  /** @return the std */
  public double getStd() {
    Vector stds = pointSquaredTotal.times(getNumPoints()).minus(
          getPointTotal().times(getPointTotal())).assign(new SquareRootFunction())
          .divide(getNumPoints());
    return stds.zSum() / 2;
  }

}
View Full Code Here

  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

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.