org.apache.mahout.clustering
Class RunningSumsGaussianAccumulator
java.lang.Object
org.apache.mahout.clustering.RunningSumsGaussianAccumulator
- All Implemented Interfaces:
- GaussianAccumulator
public class RunningSumsGaussianAccumulator
- extends Object
- implements GaussianAccumulator
An online Gaussian accumulator that uses a running power sums approach as reported
on http://en.wikipedia.org/wiki/Standard_deviation
Suffers from overflow, underflow and roundoff error but has minimal observe-time overhead
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RunningSumsGaussianAccumulator
public RunningSumsGaussianAccumulator()
getN
public double getN()
- Specified by:
getN
in interface GaussianAccumulator
- Returns:
- the number of observations
getMean
public Vector getMean()
- Specified by:
getMean
in interface GaussianAccumulator
- Returns:
- the mean of the observations
getStd
public Vector getStd()
- Specified by:
getStd
in interface GaussianAccumulator
- Returns:
- the std of the observations
getAverageStd
public double getAverageStd()
- Specified by:
getAverageStd
in interface GaussianAccumulator
- Returns:
- the average of the vector std elements
getVariance
public Vector getVariance()
- Specified by:
getVariance
in interface GaussianAccumulator
- Returns:
- the variance of the observations
observe
public void observe(Vector x,
double weight)
- Description copied from interface:
GaussianAccumulator
- Observe the vector
- Specified by:
observe
in interface GaussianAccumulator
- Parameters:
x
- a Vectorweight
- the double observation weight (usually 1.0)
compute
public void compute()
- Description copied from interface:
GaussianAccumulator
- Compute the mean, variance and standard deviation
- Specified by:
compute
in interface GaussianAccumulator
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.