org.apache.mahout.cf.taste.impl.common
Class FixedRunningAverageAndStdDev

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.common.FixedRunningAverage
      extended by org.apache.mahout.cf.taste.impl.common.FixedRunningAverageAndStdDev
All Implemented Interfaces:
Serializable, RunningAverage, RunningAverageAndStdDev

public final class FixedRunningAverageAndStdDev
extends FixedRunningAverage
implements RunningAverageAndStdDev

A simple class that represents a fixed value of an average, count and standard deviation. This is useful when an API needs to return RunningAverageAndStdDev but is not in a position to accept updates to it.

See Also:
Serialized Form

Constructor Summary
FixedRunningAverageAndStdDev(double average, double stdDev, int count)
           
 
Method Summary
 double getStandardDeviation()
           
 RunningAverageAndStdDev inverse()
           
 String toString()
           
 
Methods inherited from class org.apache.mahout.cf.taste.impl.common.FixedRunningAverage
addDatum, changeDatum, getAverage, getCount, removeDatum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.mahout.cf.taste.impl.common.RunningAverage
addDatum, changeDatum, getAverage, getCount, removeDatum
 

Constructor Detail

FixedRunningAverageAndStdDev

public FixedRunningAverageAndStdDev(double average,
                                    double stdDev,
                                    int count)
Method Detail

inverse

public RunningAverageAndStdDev inverse()
Specified by:
inverse in interface RunningAverage
Specified by:
inverse in interface RunningAverageAndStdDev
Overrides:
inverse in class FixedRunningAverage
Returns:
a (possibly immutable) object whose average is the negative of this object's

toString

public String toString()
Overrides:
toString in class FixedRunningAverage

getStandardDeviation

public double getStandardDeviation()
Specified by:
getStandardDeviation in interface RunningAverageAndStdDev
Returns:
standard deviation of data


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.