Class RocCalculator

java.lang.Object
edu.cmu.tetrad.util.RocCalculator

public class RocCalculator extends Object
Calculates a ROC curve and AUC (area under curve) for a list of scored cases whose inclusion in category C is known.
Author:
josephramsey and Frank Wimberly
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RocCalculator(double[] scores, boolean[] inCategory, int direction)
    Constructs a calculator using the parameter information below.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Calculates the area under the ROC curve using a very clever Ramsey idea.
    double[][]
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RocCalculator

      public RocCalculator(double[] scores, boolean[] inCategory, int direction)
      Constructs a calculator using the parameter information below.
      Parameters:
      scores - The scores to be plotted.
      inCategory - Whether each score is in the category in question or not. Must be an array of the same length as scores.
      direction - Either RocCalculator.ASCENDING or RocCalculator.DESCENDING.
  • Method Details

    • getAuc

      public double getAuc()
      Calculates the area under the ROC curve using a very clever Ramsey idea.
      Returns:
      the area under the ROC curve (AUC).
    • getScaledRocPlot

      public double[][] getScaledRocPlot()