org.apache.mahout.math.stats
Class GroupedOnlineAuc

java.lang.Object
  extended by org.apache.mahout.math.stats.GroupedOnlineAuc
All Implemented Interfaces:
org.apache.hadoop.io.Writable, OnlineAuc

public class GroupedOnlineAuc
extends Object
implements OnlineAuc

Implements a variant on AUC where the result returned is an average of several AUC measurements made on sub-groups of the overall data. Controlling for the grouping factor allows the effects of the grouping factor on the model to be ignored. This is useful, for instance, when using a classifier as a click prediction engine. In that case you want AUC to refer only to the ranking of items for a particular user, not to the discrimination of users from each other. Grouping by user (or user cluster) helps avoid optimizing for the wrong quality.


Constructor Summary
GroupedOnlineAuc()
           
 
Method Summary
 double addSample(int category, double score)
           
 double addSample(int category, String groupKey, double score)
           
 double auc()
           
 void readFields(DataInput in)
           
 void setPolicy(org.apache.mahout.math.stats.GlobalOnlineAuc.ReplacementPolicy policy)
           
 void setWindowSize(int windowSize)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupedOnlineAuc

public GroupedOnlineAuc()
Method Detail

addSample

public double addSample(int category,
                        String groupKey,
                        double score)
Specified by:
addSample in interface OnlineAuc

addSample

public double addSample(int category,
                        double score)
Specified by:
addSample in interface OnlineAuc

auc

public double auc()
Specified by:
auc in interface OnlineAuc

setPolicy

public void setPolicy(org.apache.mahout.math.stats.GlobalOnlineAuc.ReplacementPolicy policy)
Specified by:
setPolicy in interface OnlineAuc

setWindowSize

public void setWindowSize(int windowSize)
Specified by:
setWindowSize in interface OnlineAuc

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException


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