weka.experiment
Class Grapher

java.lang.Object
  extended byweka.experiment.Grapher

public class Grapher
extends java.lang.Object

Class for producing performance graphs for any metric from learning curve results. Currently supports gnuplot format with various types of error bars


Field Summary
protected  java.lang.String arffFileName
          Name of original file of experimental result data in arff format
static short CONF_INF
          errorBar value for error bars using 95% confidence intervals
 boolean confIntErrorBars
          Set if desire error bars based on 95% confidence intervals
protected  Instances data
          Experimental result data in arff format
 java.lang.String dataset
          The name of the dataset to plot performance for
protected  java.lang.String[] datasets
          Names of datasets in data
 short errorBars
          Set if desire error bars of particular type
 java.lang.String metric
          The name of the performance metric to plot
static short MIN_MAX
          errorBar value for error bars using min and max values
static short NONE
          errorBar value for no error bars
protected  int[] points
          Ordered array of points on learning in number of training examples
protected  java.util.HashMap schemeMap
          Map from scheme + options name to result data in the form of an array of Stats's, one for each learning curve point in points
static short STD_DEV
          errorBar value for error bars using standard deviations
 
Constructor Summary
Grapher(java.lang.String arffFileName, short errorBars)
          Create an initial Grapher and load in data, names of datasets, and set of points on learning curve.
 
Method Summary
 void gnuplot()
          Generate gnuplot files for plotting a learning curve for the current dataset and metric.
 void gnuplotAllDatasets()
          Produce a gnuplot for each dataset in the result file
static void main(java.lang.String[] args)
          Create gnuplot graphs of learning curves.
protected  void processData()
          Read in data for the current values of dataset and metric by indexing for each scheme+options name an array of Stats objects for each point on the learning curve
static java.lang.String removeFileExtension(java.lang.String fileName)
          Return the name of a file with the extension removed
protected  void setData()
          Load data for graph in from the given Experiment result file in arff format
protected  void setDatasets()
          Set array of points on learning curve from Key_Dataset values in data
protected  void setPoints()
          Set array of points on learning curve from Key_Total_instances values in data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected Instances data
Experimental result data in arff format


datasets

protected java.lang.String[] datasets
Names of datasets in data


schemeMap

protected java.util.HashMap schemeMap
Map from scheme + options name to result data in the form of an array of Stats's, one for each learning curve point in points


points

protected int[] points
Ordered array of points on learning in number of training examples


arffFileName

protected java.lang.String arffFileName
Name of original file of experimental result data in arff format


metric

public java.lang.String metric
The name of the performance metric to plot


errorBars

public short errorBars
Set if desire error bars of particular type


NONE

public static short NONE
errorBar value for no error bars


STD_DEV

public static short STD_DEV
errorBar value for error bars using standard deviations


CONF_INF

public static short CONF_INF
errorBar value for error bars using 95% confidence intervals


MIN_MAX

public static short MIN_MAX
errorBar value for error bars using min and max values


confIntErrorBars

public boolean confIntErrorBars
Set if desire error bars based on 95% confidence intervals


dataset

public java.lang.String dataset
The name of the dataset to plot performance for

Constructor Detail

Grapher

public Grapher(java.lang.String arffFileName,
               short errorBars)
        throws java.lang.Exception
Create an initial Grapher and load in data, names of datasets, and set of points on learning curve.

Method Detail

setData

protected void setData()
                throws java.lang.Exception
Load data for graph in from the given Experiment result file in arff format

Throws:
java.lang.Exception

setPoints

protected void setPoints()
                  throws java.lang.Exception
Set array of points on learning curve from Key_Total_instances values in data

Throws:
java.lang.Exception

setDatasets

protected void setDatasets()
                    throws java.lang.Exception
Set array of points on learning curve from Key_Dataset values in data

Throws:
java.lang.Exception

processData

protected void processData()
                    throws java.lang.Exception
Read in data for the current values of dataset and metric by indexing for each scheme+options name an array of Stats objects for each point on the learning curve

Throws:
java.lang.Exception

gnuplot

public void gnuplot()
             throws java.lang.Exception
Generate gnuplot files for plotting a learning curve for the current dataset and metric. Assumes a processData was last performed for this case dataset and metric

Throws:
java.lang.Exception

removeFileExtension

public static java.lang.String removeFileExtension(java.lang.String fileName)
Return the name of a file with the extension removed


gnuplotAllDatasets

public void gnuplotAllDatasets()
                        throws java.lang.Exception
Produce a gnuplot for each dataset in the result file

Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Create gnuplot graphs of learning curves. The first argument should be the name of an arff file of experimental result for a learning curve experiment. If present, the second argument should be the name of a performance metric in result file to plot (which defaults to Percent_correct). Options are:

Throws:
java.lang.Exception