procope.evaluation.networkperformance
Class ROCCurveHandler

java.lang.Object
  extended by procope.evaluation.networkperformance.ROCCurveHandler

public class ROCCurveHandler
extends Object

Contains static functions for writing ROC curves to files and creating actual plots from the ROC curves using Gnuplot or the JFreeChart library.

Author:
Jan Krumsiek

Constructor Summary
ROCCurveHandler()
           
 
Method Summary
static org.jfree.chart.JFreeChart generateChart(List<ROCCurve> rocCurves, List<String> names)
          Creates a line diagram as a JFreeChart from a given list of ROC curves.
static org.jfree.chart.JFreeChart generateChart(List<ROCCurve> rocCurves, List<String> names, float fpMax)
          Creates a line diagram as a JFreeChart from a given list of ROC curves.
static void writeToFile(ROCCurve rocCurve, File outFile)
          Writes the data of a ROC curve to a file.
static void writeToFile(ROCCurve rocCurve, String outFile)
          Writes the data of a ROC curve to a file.
static void writeToStream(ROCCurve rocCurve, OutputStream stream)
          Write the data of a ROC curve to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ROCCurveHandler

public ROCCurveHandler()
Method Detail

writeToFile

public static void writeToFile(ROCCurve rocCurve,
                               String outFile)
                        throws FileNotFoundException
Writes the data of a ROC curve to a file. One line contains one point of the curve, false positive rate and true positive rate are seperated by a TAB character.

Parameters:
rocCurve - ROC curve to be written out
outFile - output file
Throws:
FileNotFoundException - if the file could not be opened

writeToFile

public static void writeToFile(ROCCurve rocCurve,
                               File outFile)
                        throws FileNotFoundException
Writes the data of a ROC curve to a file. One line contains one point of the curve, false positive rate and true positive rate are seperated by a TAB character.

Parameters:
rocCurve - ROC curve to be written out
outFile - output file
Throws:
FileNotFoundException - if the file could not be opened

writeToStream

public static void writeToStream(ROCCurve rocCurve,
                                 OutputStream stream)
Write the data of a ROC curve to an output stream. One line contains one point of the curve, false positive rate and true positive rate are seperated by a TAB character.

Parameters:
rocCurve - ROC curve to be written out
stream - output stream the data will be written to

generateChart

public static org.jfree.chart.JFreeChart generateChart(List<ROCCurve> rocCurves,
                                                       List<String> names)
Creates a line diagram as a JFreeChart from a given list of ROC curves.

Parameters:
rocCurves - list of ROC curves
names - list of names for the ROC curves to be used in the diagram
Returns:
diagram chart containing the ROC curves

generateChart

public static org.jfree.chart.JFreeChart generateChart(List<ROCCurve> rocCurves,
                                                       List<String> names,
                                                       float fpMax)
Creates a line diagram as a JFreeChart from a given list of ROC curves.

Parameters:
rocCurves - list of ROC curves
names - list of names for the ROC curves to be used in the diagram
fpMax - only plot false-positive rate up to this value
Returns:
diagram chart containing the ROC curves