org.apache.mahout.cf.taste.impl.common
Interface RunningAverage
- All Known Subinterfaces:
- RunningAverageAndStdDev
- All Known Implementing Classes:
- FixedRunningAverage, FixedRunningAverageAndStdDev, FullRunningAverage, FullRunningAverageAndStdDev, InvertedRunningAverage, InvertedRunningAverageAndStdDev, WeightedRunningAverage, WeightedRunningAverageAndStdDev
public interface RunningAverage
Interface for classes that can keep track of a running average of a series of numbers. One can add to or
remove from the series, as well as update a datum in the series. The class does not actually keep track of
the series of values, just its running average, so it doesn't even matter if you remove/change a value that
wasn't added.
addDatum
void addDatum(double datum)
- Parameters:
datum
- new item to add to the running average
- Throws:
IllegalArgumentException
- if datum is Double.NaN
removeDatum
void removeDatum(double datum)
- Parameters:
datum
- item to remove to the running average
- Throws:
IllegalArgumentException
- if datum is Double.NaN
IllegalStateException
- if count is 0
changeDatum
void changeDatum(double delta)
- Parameters:
delta
- amount by which to change a datum in the running average
- Throws:
IllegalArgumentException
- if delta is Double.NaN
IllegalStateException
- if count is 0
getCount
int getCount()
getAverage
double getAverage()
inverse
RunningAverage inverse()
- Returns:
- a (possibly immutable) object whose average is the negative of this object's
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.