icb-stats API icb-stats-31 (20120309094430)

edu.cornell.med.icb.stat
Class PredictionStatisticCalculator

java.lang.Object
  extended by edu.cornell.med.icb.stat.PredictionStatisticCalculator
Direct Known Subclasses:
AccuracyCalculator, AreaUnderTheRocCurveCalculator, MatthewsCorrelationCalculator, RootMeanSquaredErrorCalculator, SensitivityCalculator, SpecificityCalculator

public abstract class PredictionStatisticCalculator
extends Object

Author:
Fabien Campagne Date: Oct 8, 2009 Time: 5:22:59 PM

Field Summary
protected  boolean highestStatisticIsBest
          Indicates that a larger statistic represents a better predictor performance.
 double optimalThreshold
          The value of the threshold where the optimal statistic is obtained.
protected  double statistic
          The value of the statistic.
protected  double zero
          This value indicates the value of the performance statistics that would be obtained if the prediction was completely random.
 
Constructor Summary
PredictionStatisticCalculator()
           
 
Method Summary
protected  void evaluateContingencyTable(double threshold, double[] decisionValues, double[] labels)
          Evaluate the contingency table at a specific threshold.
abstract  double evaluateStatisticAtThreshold(double threshold, double[] decisionValues, double[] labels)
          Evaluate the statistic for a given decision function threshold.
 double evaluateStatisticAtThreshold(double threshold, ObjectList<double[]> decisionValueList, ObjectList<double[]> labelList)
           
abstract  String getMeasureName()
           
protected  double predictivePotential(double statisticsValueAtThreshold)
          Return a value that is larger when the statistics indicates a larger predictive potential.
 double thresholdIndependentStatistic(double[] decisionValues, double[] labels)
          Calculates the Matthews Correlation coefficient.
 double thresholdIndependentStatistic(ObjectList<double[]> decisionValueList, ObjectList<double[]> labelList)
          Calculates the optimal statistic at any decision threshold.
 double thresholdIndependentStatisticStd(ObjectList<double[]> decisionValueList, ObjectList<double[]> trueLabelList)
           
 double thresholdIndependentStatisticSte(ObjectList<double[]> decisionValueList, ObjectList<double[]> trueLabelList)
          Calculate the standard error of the mean of the statistic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

optimalThreshold

public double optimalThreshold
The value of the threshold where the optimal statistic is obtained.


statistic

protected double statistic
The value of the statistic.


highestStatisticIsBest

protected boolean highestStatisticIsBest
Indicates that a larger statistic represents a better predictor performance.


zero

protected double zero
This value indicates the value of the performance statistics that would be obtained if the prediction was completely random.

Constructor Detail

PredictionStatisticCalculator

public PredictionStatisticCalculator()
Method Detail

evaluateContingencyTable

protected void evaluateContingencyTable(double threshold,
                                        double[] decisionValues,
                                        double[] labels)
Evaluate the contingency table at a specific threshold. The values of TP, TN, FP, FN are populated when this method returns. The parameters decisionValues and labels are not modified.

Parameters:
threshold -
decisionValues -
labels -

getMeasureName

public abstract String getMeasureName()

thresholdIndependentStatistic

public double thresholdIndependentStatistic(ObjectList<double[]> decisionValueList,
                                            ObjectList<double[]> labelList)
Calculates the optimal statistic at any decision threshold. All the possible thresholds on the decision value are scanned and the optimal statistic found is returned. When highestStatisticIsBest is true, the largest statistic found at any threshold is returned. Otherwise, the lowest statistic is returned.

Parameters:
decisionValueList - Each element of this list should corresponds to a split of evaluation (decision values).
labelList - Each element of this list should corresponds to a split of evaluation (true labels).
Returns:

predictivePotential

protected double predictivePotential(double statisticsValueAtThreshold)
Return a value that is larger when the statistics indicates a larger predictive potential. Absolute value is taken because values below 'zero' indicate predictive ability as well (just anti-correlated with the correct prediction). The 'zero' used here is the value of the performance metric that indicates random prediction.

Parameters:
statisticsValueAtThreshold -
Returns:

thresholdIndependentStatistic

public double thresholdIndependentStatistic(double[] decisionValues,
                                            double[] labels)
Calculates the Matthews Correlation coefficient. Find the maximal MCC value irrespective of the threshold on the decision value. All the possible thresholds on the decision value are scanned and the maximum MCC values found is returned.

Parameters:
decisionValues -
labels -
Returns:

thresholdIndependentStatisticStd

public double thresholdIndependentStatisticStd(ObjectList<double[]> decisionValueList,
                                               ObjectList<double[]> trueLabelList)

thresholdIndependentStatisticSte

public double thresholdIndependentStatisticSte(ObjectList<double[]> decisionValueList,
                                               ObjectList<double[]> trueLabelList)
Calculate the standard error of the mean of the statistic. Return Std of the statistic divided by the square root of the number of observations.

Parameters:
decisionValueList -
trueLabelList -
Returns:

evaluateStatisticAtThreshold

public double evaluateStatisticAtThreshold(double threshold,
                                           ObjectList<double[]> decisionValueList,
                                           ObjectList<double[]> labelList)

evaluateStatisticAtThreshold

public abstract double evaluateStatisticAtThreshold(double threshold,
                                                    double[] decisionValues,
                                                    double[] labels)
Evaluate the statistic for a given decision function threshold.

Parameters:
threshold -
decisionValues -
labels -

icb-stats API icb-stats-31 (20120309094430)

Copyright © 2008-2012 Institute for Computational Biomedicine, All Rights Reserved.