gov.sandia.cognition.statistics.method
Class ReceiverOperatingCharacteristic

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.method.ReceiverOperatingCharacteristic
All Implemented Interfaces:
Evaluator<Double,Double>, CloneableSerializable, Serializable, Cloneable

@PublicationReference(author="Wikipedia",
                      title="Receiver operating characteristic",
                      type=WebPage,
                      year=2009,
                      url="http://en.wikipedia.org/wiki/Receiver_operating_characteristic")
public class ReceiverOperatingCharacteristic
extends AbstractCloneableSerializable
implements Evaluator<Double,Double>

Class that describes a Receiver Operating Characteristic (usually called an "ROC Curve"). This is a function that describes the performance of a classification system where the x-axis is the FalsePositiveRate and the y-axis is the TruePositiveRate. Both axes are on the interval [0,1]. A typical ROC curve has a logarithm-shaped plot, ideally it looks like a capital Gamma letter. An ROC curve also has an associated group of statistics with it from a Mann-Whitney U-test, which gives the probability that the classifier is essentially randomly "guessing." We create ROC curves by calling the method: ReceiverOperatingCharacteristic.create(data)

Since:
2.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Nested Class Summary
static class ReceiverOperatingCharacteristic.DataPoint
          Contains information about a datapoint on an ROC curve
static class ReceiverOperatingCharacteristic.Statistic
          Contains useful statistics derived from a ROC curve
 
Method Summary
 ReceiverOperatingCharacteristic clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 ReceiverOperatingCharacteristic.Statistic computeStatistics()
          Computes useful statistical information associated with the ROC curve
static ReceiverOperatingCharacteristic create(Collection<? extends InputOutputPair<Double,Boolean>> data)
          Creates an ROC curve based on the scored data with target information
static ReceiverOperatingCharacteristic createFromTargetEstimatePairs(Collection<? extends Pair<Boolean,? extends Number>> data)
          Creates an ROC curve based on the scored data with target information.
 Double evaluate(Double input)
          Evaluates the "pessimistic" value of the truePositiveRate for a given falsePositiveRate.
 ArrayList<ReceiverOperatingCharacteristic.DataPoint> getSortedROCData()
          Getter for sortedROCData
 MannWhitneyUConfidence.Statistic getUtest()
          Getter for Utest
protected  void setSortedROCData(ArrayList<ReceiverOperatingCharacteristic.DataPoint> sortedROCData)
          Setter for srtedROCData
 void setUtest(MannWhitneyUConfidence.Statistic Utest)
          Setter for Utest
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clone

public ReceiverOperatingCharacteristic clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

evaluate

public Double evaluate(Double input)
Evaluates the "pessimistic" value of the truePositiveRate for a given falsePositiveRate. This evaluation is pessimistic in that it holds the truePositiveRate (y-value) until we receive a corresponding falsePositiveRate (x-value) that is greater than the given value

Specified by:
evaluate in interface Evaluator<Double,Double>
Parameters:
input - falsePositiveRate from which to estimate the truePositiveRate
Returns:
Pessimistic TruePositiveRate for the given FalsePositiveRate

getSortedROCData

public ArrayList<ReceiverOperatingCharacteristic.DataPoint> getSortedROCData()
Getter for sortedROCData

Returns:
Sorted data containing a ConfusionMatrix at each point, sorted in an ascending order along the abscissa (x-axis), which is FalsePositiveRate

setSortedROCData

protected void setSortedROCData(ArrayList<ReceiverOperatingCharacteristic.DataPoint> sortedROCData)
Setter for srtedROCData

Parameters:
sortedROCData - Sorted data containing a ConfusionMatrix at each point, sorted in an ascending order along the abscissa (x-axis), which is FalsePositiveRate

createFromTargetEstimatePairs

public static ReceiverOperatingCharacteristic createFromTargetEstimatePairs(Collection<? extends Pair<Boolean,? extends Number>> data)
Creates an ROC curve based on the scored data with target information.

Parameters:
data - Collection of target/estimate-score pairs. The second element in the pair is an estimated score, the first is a flag to determine which group the score belongs to. For example: {(true, 1.0), (false, 0.9)} means that data1=1.0 and data2=0.9 and so forth. This is useful for computing that classified data partitions data better than chance.
Returns:
ROC Curve describing the scoring system versus the targets.

create

public static ReceiverOperatingCharacteristic create(Collection<? extends InputOutputPair<Double,Boolean>> data)
Creates an ROC curve based on the scored data with target information

Parameters:
data - Collection of estimate-score/target pairs. The second element in the Pair is an estimated score, the first is a flag to determine which group the score belongs to. For example {<1.0,true>, <0.9,false> means that data1=1.0 and data2=0.9 and so forth. This is useful for computing that classified data partitions data better than chance.
Returns:
ROC Curve describing the scoring system versus the targets

computeStatistics

public ReceiverOperatingCharacteristic.Statistic computeStatistics()
Computes useful statistical information associated with the ROC curve

Returns:
ROC Statistics describing the ROC curve

getUtest

public MannWhitneyUConfidence.Statistic getUtest()
Getter for Utest

Returns:
Results from conducting a U-test on the underlying classification data, the null hypothesis determines if the classifier can reliably separate the classes, not just chance

setUtest

public void setUtest(MannWhitneyUConfidence.Statistic Utest)
Setter for Utest

Parameters:
Utest - Results from conducting a U-test on the underlying classification data, the null hypothesis determines if the classifier can reliably separate the classes, not just chance