Package edu.cmu.tetrad.util
Class RocCalculator
java.lang.Object
edu.cmu.tetrad.util.RocCalculator
Calculates a ROC curve and AUC (area under curve) for a list of scored cases whose inclusion in category C is known.
- Version:
- $Id: $Id
- Author:
- josephramsey and Frank Wimberly
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRocCalculator
(double[] scores, boolean[] inCategory, int direction) Constructs a calculator using the parameter information below. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getAuc()
Calculates the area under the ROC curve using a very clever Ramsey idea.double[][]
getScaledRocPlot.
-
Field Details
-
ASCENDING
public static final int ASCENDINGConstantASCENDING=0
- See Also:
-
-
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()getScaledRocPlot.
- Returns:
- an array of objects
-