net.myrrix.common.stats
Class WeightedRunningAverage

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

public final class WeightedRunningAverage
extends Object
implements org.apache.mahout.cf.taste.impl.common.RunningAverage, Serializable

Ported from Mahout WeightedRunningAverage but uses int weights.

Author:
Mahout
See Also:
Serialized Form

Constructor Summary
WeightedRunningAverage()
           
 
Method Summary
 void addDatum(double datum)
           
 void addDatum(double datum, int weight)
           
 void changeDatum(double delta)
           
 void changeDatum(double delta, int weight)
           
 double getAverage()
           
 int getCount()
           
 double getTotalWeight()
           
 org.apache.mahout.cf.taste.impl.common.RunningAverage inverse()
           
 void removeDatum(double datum)
           
 void removeDatum(double datum, int weight)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeightedRunningAverage

public WeightedRunningAverage()
Method Detail

addDatum

public void addDatum(double datum)
Specified by:
addDatum in interface org.apache.mahout.cf.taste.impl.common.RunningAverage

addDatum

public void addDatum(double datum,
                     int weight)

removeDatum

public void removeDatum(double datum)
Specified by:
removeDatum in interface org.apache.mahout.cf.taste.impl.common.RunningAverage

removeDatum

public void removeDatum(double datum,
                        int weight)

changeDatum

public void changeDatum(double delta)
Specified by:
changeDatum in interface org.apache.mahout.cf.taste.impl.common.RunningAverage

changeDatum

public void changeDatum(double delta,
                        int weight)

getTotalWeight

public double getTotalWeight()

getCount

public int getCount()
Specified by:
getCount in interface org.apache.mahout.cf.taste.impl.common.RunningAverage
Returns:
getTotalWeight()

getAverage

public double getAverage()
Specified by:
getAverage in interface org.apache.mahout.cf.taste.impl.common.RunningAverage

inverse

public org.apache.mahout.cf.taste.impl.common.RunningAverage inverse()
Specified by:
inverse in interface org.apache.mahout.cf.taste.impl.common.RunningAverage
Throws:
UnsupportedOperationException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.