Examples of SquareRootFunction


Examples of org.apache.mahout.math.function.SquareRootFunction

      return;
    }
    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() / std.size();
    } else {
      stdDev = Double.MIN_VALUE;
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

      return;
    }
    mean = s1.divide(s0);
    // compute the component stds
    if (s0 > 1) {
      stdDev = s2.times(s0).minus(s1.times(s1)).assign(new SquareRootFunction()).divide(s0);
    } else {
      stdDev.assign(Double.MIN_NORMAL);
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

 
  /** 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.function.SquareRootFunction

    return mean;
  }

  @Override
  public Vector getStd() {
    return variance.clone().assign(new SquareRootFunction());
  }
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

    }
    numPoints = (int) s0;
    center = s1.divide(s0);
    // compute the component stds
    if (s0 > 1) {
      radius = s2.times(s0).minus(s1.times(s1)).assign(new SquareRootFunction()).divide(s0);
    } else {
      radius.assign(Double.MIN_NORMAL);
    }
    s0 = 0;
    s1 = null;
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

  public void compute() {
    if (s0 == 0) {
      return;
    }
    mean = s1.divide(s0);
    std = s2.times(s0).minus(s1.times(s1)).assign(new SquareRootFunction()).divide(s0);
  }
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

    setNumPoints((int) getS0());
    setCenter(getS1().divide(getS0()));
    // compute the component stds
    if (getS0() > 1) {
      setRadius(getS2().times(getS0()).minus(getS1().times(getS1()))
          .assign(new SquareRootFunction()).divide(getS0()));
    }
    setS0(0);
    setS1(null);
    setS2(null);
  }
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

      return;
    }
    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() / std.size();
    } else {
      stdDev = Double.MIN_VALUE;
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

      return;
    }
    mean = s1.divide(s0);
    // compute the component stds
    if (s0 > 1) {
      stdDev = s2.times(s0).minus(s1.times(s1)).assign(new SquareRootFunction()).divide(s0);
    } else {
      stdDev.assign(Double.MIN_NORMAL);
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.function.SquareRootFunction

 
  /** @return the std */
  public double getStd() {
    if (getNumPoints() == 0) return std;
    Vector stds = pointSquaredTotal.times(getNumPoints()).minus(getPointTotal().times(getPointTotal()))
        .assign(new SquareRootFunction()).divide(getNumPoints());
    return stds.zSum() / stds.size();
  }
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.