All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.experiment.PairedTTester

java.lang.Object
    |
    +----weka.experiment.PairedTTester

public class PairedTTester
extends java.lang.Object
implements OptionHandler
Calculates T-Test statistics on data stored in a set of instances.

Valid options from the command-line are:

-D num,num2...
The column numbers that uniquely specify a dataset. (default last)

-R num
The column number containing the run number. (default last)

-S num
The significance level for T-Tests. (default 0.05)

-R num,num2...
The column numbers that uniquely specify one result generator (eg: scheme name plus options). (default last)

Version:
$Revision: 1.14 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o PairedTTester()
 

Method Index

 o calculateStatistics(Instance, int, int, int)
Computes a paired t-test comparison for a specified dataset between two resultsets.
 o getDatasetKeyColumns()
Get the value of DatasetKeyColumns.
 o getInstances()
Get the value of Instances.
 o getNumDatasets()
Gets the number of datasets in the resultsets
 o getNumResultsets()
Gets the number of resultsets in the data.
 o getOptions()
Gets current settings of the PairedTTester.
 o getProduceLatex()
Get whether latex is output
 o getResultsetKeyColumns()
Get the value of ResultsetKeyColumns.
 o getResultsetName(int)
Gets a string descriptive of the specified resultset.
 o getRunColumn()
Get the value of RunColumn.
 o getShowStdDevs()
Returns true if standard deviations have been requested.
 o getSignificanceLevel()
Get the value of SignificanceLevel.
 o header(int)
Creates a "header" string describing the current resultsets.
 o listOptions()
Lists options understood by this object.
 o main(String[])
Test the class from the command line.
 o multiResultsetFull(int, int)
Creates a comparison table where a base resultset is compared to the other resultsets.
 o multiResultsetRanking(int)
 
 o multiResultsetSummary(int)
Carries out a comparison between all resultsets, counting the number of datsets where one resultset outperforms the other.
 o multiResultsetWins(int)
Carries out a comparison between all resultsets, counting the number of datsets where one resultset outperforms the other.
 o resultsetKey()
Creates a key that maps resultset numbers to their descriptions.
 o setDatasetKeyColumns(Range)
Set the value of DatasetKeyColumns.
 o setInstances(Instances)
Set the value of Instances.
 o setOptions(String[])
Parses a given list of options.
 o setProduceLatex(boolean)
Set whether latex is output
 o setResultsetKeyColumns(Range)
Set the value of ResultsetKeyColumns.
 o setRunColumn(int)
Set the value of RunColumn.
 o setShowStdDevs(boolean)
Set whether standard deviations are displayed or not.
 o setSignificanceLevel(double)
Set the value of SignificanceLevel.

Constructor Detail

 o PairedTTester
public PairedTTester()

Method Detail

 o setProduceLatex
public void setProduceLatex(boolean l)
          Set whether latex is output
Parameters:
l - true if tables are to be produced in Latex format
 o getProduceLatex
public boolean getProduceLatex()
          Get whether latex is output
Returns:
true if Latex is to be output
 o setShowStdDevs
public void setShowStdDevs(boolean s)
          Set whether standard deviations are displayed or not.
Parameters:
s - true if standard deviations are to be displayed
 o getShowStdDevs
public boolean getShowStdDevs()
          Returns true if standard deviations have been requested.
Returns:
true if standard deviations are to be displayed.
 o getNumDatasets
public int getNumDatasets()
          Gets the number of datasets in the resultsets
Returns:
the number of datasets in the resultsets
 o getNumResultsets
public int getNumResultsets()
          Gets the number of resultsets in the data.
Returns:
the number of resultsets in the data
 o getResultsetName
public java.lang.String getResultsetName(int index)
          Gets a string descriptive of the specified resultset.
Parameters:
index - the index of the resultset
Returns:
a descriptive string for the resultset
 o calculateStatistics
public PairedStats calculateStatistics(Instance datasetSpecifier,
                                       int resultset1Index,
                                       int resultset2Index,
                                       int comparisonColumn) throws java.lang.Exception
          Computes a paired t-test comparison for a specified dataset between two resultsets.
Parameters:
datasetSpecifier - the dataset specifier
resultset1Index - the index of the first resultset
resultset2Index - the index of the second resultset
comparisonColumn - the column containing values to compare
Returns:
the results of the paired comparison
Throws:
java.lang.Exception - if an error occurs
 o resultsetKey
public java.lang.String resultsetKey()
          Creates a key that maps resultset numbers to their descriptions.
Returns:
a value of type 'String'
 o header
public java.lang.String header(int comparisonColumn)
          Creates a "header" string describing the current resultsets.
Parameters:
comparisonColumn - a value of type 'int'
Returns:
a value of type 'String'
 o multiResultsetWins
public int[][] multiResultsetWins(int comparisonColumn) throws java.lang.Exception
          Carries out a comparison between all resultsets, counting the number of datsets where one resultset outperforms the other.
Parameters:
comparisonColumn - the index of the comparison column
Returns:
a 2d array where element [i][j] is the number of times resultset j performed significantly better than resultset i.
Throws:
java.lang.Exception - if an error occurs
 o multiResultsetSummary
public java.lang.String multiResultsetSummary(int comparisonColumn) throws java.lang.Exception
          Carries out a comparison between all resultsets, counting the number of datsets where one resultset outperforms the other. The results are summarized in a table.
Parameters:
comparisonColumn - the index of the comparison column
Returns:
the results in a string
Throws:
java.lang.Exception - if an error occurs
 o multiResultsetRanking
public java.lang.String multiResultsetRanking(int comparisonColumn) throws java.lang.Exception
 o multiResultsetFull
public java.lang.String multiResultsetFull(int baseResultset,
                                 int comparisonColumn) throws java.lang.Exception
          Creates a comparison table where a base resultset is compared to the other resultsets. Results are presented for every dataset.
Parameters:
baseResultset - the index of the base resultset
comparisonColumn - the index of the column to compare over
Returns:
the comparison table string
Throws:
java.lang.Exception - if an error occurs
 o listOptions
public java.util.Enumeration listOptions()
          Lists options understood by this object.
Returns:
an enumeration of Options.
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are:

-D num,num2...
The column numbers that uniquely specify a dataset. (default last)

-R num
The column number containing the run number. (default last)

-S num
The significance level for T-Tests. (default 0.05)

-R num,num2...
The column numbers that uniquely specify one result generator (eg: scheme name plus options). (default last)

-V
Show standard deviations

-L
Produce comparison tables in Latex table format

Parameters:
options - an array containing options to set.
Throws:
java.lang.Exception - if invalid options are given
 o getOptions
public java.lang.String[] getOptions()
          Gets current settings of the PairedTTester.
Returns:
an array of strings containing current options.
 o getResultsetKeyColumns
public Range getResultsetKeyColumns()
          Get the value of ResultsetKeyColumns.
Returns:
Value of ResultsetKeyColumns.
 o setResultsetKeyColumns
public void setResultsetKeyColumns(Range newResultsetKeyColumns)
          Set the value of ResultsetKeyColumns.
Parameters:
newResultsetKeyColumns - Value to assign to ResultsetKeyColumns.
 o getSignificanceLevel
public double getSignificanceLevel()
          Get the value of SignificanceLevel.
Returns:
Value of SignificanceLevel.
 o setSignificanceLevel
public void setSignificanceLevel(double newSignificanceLevel)
          Set the value of SignificanceLevel.
Parameters:
newSignificanceLevel - Value to assign to SignificanceLevel.
 o getDatasetKeyColumns
public Range getDatasetKeyColumns()
          Get the value of DatasetKeyColumns.
Returns:
Value of DatasetKeyColumns.
 o setDatasetKeyColumns
public void setDatasetKeyColumns(Range newDatasetKeyColumns)
          Set the value of DatasetKeyColumns.
Parameters:
newDatasetKeyColumns - Value to assign to DatasetKeyColumns.
 o getRunColumn
public int getRunColumn()
          Get the value of RunColumn.
Returns:
Value of RunColumn.
 o setRunColumn
public void setRunColumn(int newRunColumn)
          Set the value of RunColumn.
Parameters:
newRunColumn - Value to assign to RunColumn.
 o getInstances
public Instances getInstances()
          Get the value of Instances.
Returns:
Value of Instances.
 o setInstances
public void setInstances(Instances newInstances)
          Set the value of Instances.
Parameters:
newInstances - Value to assign to Instances.
 o main
public static void main(java.lang.String args[])
          Test the class from the command line.
Parameters:
args - contains options for the instance ttests

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home