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

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

public final class WeightedRunningAverageAndStdDev
extends WeightedRunningAverage
implements RunningAverageAndStdDev

This subclass also provides for a weighted estimate of the sample standard deviation. See estimate formulae here.

See Also:
Serialized Form

Constructor Summary
WeightedRunningAverageAndStdDev()
           
 
Method Summary
 void addDatum(double datum, double weight)
           
 void changeDatum(double delta, double weight)
           
 double getStandardDeviation()
           
 RunningAverageAndStdDev inverse()
           
 void removeDatum(double datum, double weight)
           
 String toString()
           
 
Methods inherited from class org.apache.mahout.cf.taste.impl.common.WeightedRunningAverage
addDatum, changeDatum, getAverage, getCount, getTotalWeight, 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

WeightedRunningAverageAndStdDev

public WeightedRunningAverageAndStdDev()
Method Detail

addDatum

public void addDatum(double datum,
                     double weight)
Overrides:
addDatum in class WeightedRunningAverage

removeDatum

public void removeDatum(double datum,
                        double weight)
Overrides:
removeDatum in class WeightedRunningAverage

changeDatum

public void changeDatum(double delta,
                        double weight)
Overrides:
changeDatum in class WeightedRunningAverage
Throws:
UnsupportedOperationException

getStandardDeviation

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

inverse

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

toString

public String toString()
Overrides:
toString in class WeightedRunningAverage


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