|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.experiment.PairedTTester
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)
-F num
The column number containing the fold number.
(default none)
-S num
The significance level for T-Tests.
(default 0.05)
-G num,num2...
The column numbers that uniquely specify one result generator (eg:
scheme name plus options).
(default last)
Nested Class Summary | |
protected class |
PairedTTester.Dataset
|
protected class |
PairedTTester.DatasetSpecifiers
|
protected class |
PairedTTester.Resultset
|
Field Summary | |
protected int[] |
m_DatasetKeyColumns
An array containing the indexes of just the selected columns |
protected Range |
m_DatasetKeyColumnsRange
The range of columns that specify a unique "dataset" (eg: scheme plus configuration) |
protected PairedTTester.DatasetSpecifiers |
m_DatasetSpecifiers
The list of dataset specifiers |
protected int |
m_FoldColumn
The option setting for the fold number column (-1 means none) |
protected Instances |
m_Instances
The set of instances we will analyse |
protected boolean |
m_latexOutput
Produce tables in latex format |
protected int[] |
m_ResultsetKeyColumns
An array containing the indexes of just the selected columns |
protected Range |
m_ResultsetKeyColumnsRange
The range of columns that specify a unique result set (eg: scheme plus configuration) |
protected FastVector |
m_Resultsets
Stores a vector for each resultset holding all instances in each set |
protected boolean |
m_ResultsetsValid
Indicates whether the instances have been partitioned |
protected int |
m_RunColumn
The index of the column containing the run number |
protected int |
m_RunColumnSet
The option setting for the run number column (-1 means last) |
protected boolean |
m_ShowStdDevs
Indicates whether standard deviations should be displayed |
protected double |
m_SignificanceLevel
The significance level for comparisons |
Constructor Summary | |
PairedTTester()
|
Method Summary | |
PairedStats |
calculateStatistics(Instance datasetSpecifier,
int resultset1Index,
int resultset2Index,
int comparisonColumn)
Computes a paired t-test comparison for a specified dataset between two resultsets. |
Range |
getDatasetKeyColumns()
Get the value of DatasetKeyColumns. |
int |
getFoldColumn()
Get the value of FoldColumn. |
Instances |
getInstances()
Get the value of Instances. |
int |
getNumDatasets()
Gets the number of datasets in the resultsets |
int |
getNumResultsets()
Gets the number of resultsets in the data. |
java.lang.String[] |
getOptions()
Gets current settings of the PairedTTester. |
boolean |
getProduceLatex()
Get whether latex is output |
Range |
getResultsetKeyColumns()
Get the value of ResultsetKeyColumns. |
java.lang.String |
getResultsetName(int index)
Gets a string descriptive of the specified resultset. |
int |
getRunColumn()
Get the value of RunColumn. |
boolean |
getShowStdDevs()
Returns true if standard deviations have been requested. |
double |
getSignificanceLevel()
Get the value of SignificanceLevel. |
java.lang.String |
header(int comparisonColumn)
Creates a "header" string describing the current resultsets. |
java.util.Enumeration |
listOptions()
Lists options understood by this object. |
static void |
main(java.lang.String[] args)
Test the class from the command line. |
java.lang.String |
multiResultsetFull(int baseResultset,
int comparisonColumn)
Creates a comparison table where a base resultset is compared to the other resultsets. |
private java.lang.String |
multiResultsetFullLatex(int baseResultset,
int comparisonColumn,
int maxWidthMean,
int maxWidthStdDev)
Generates a comparison table in latex table format |
private java.lang.String |
multiResultsetFullPlainText(int baseResultset,
int comparisonColumn,
int maxWidthMean,
int maxWidthStdDev)
Generates a comparison table in latex table format |
java.lang.String |
multiResultsetRanking(int comparisonColumn)
|
java.lang.String |
multiResultsetSummary(int comparisonColumn)
Carries out a comparison between all resultsets, counting the number of datsets where one resultset outperforms the other. |
int[][] |
multiResultsetWins(int comparisonColumn)
Carries out a comparison between all resultsets, counting the number of datsets where one resultset outperforms the other. |
protected void |
prepareData()
Separates the instances into resultsets and by dataset/run. |
java.lang.String |
resultsetKey()
Creates a key that maps resultset numbers to their descriptions. |
void |
setDatasetKeyColumns(Range newDatasetKeyColumns)
Set the value of DatasetKeyColumns. |
void |
setFoldColumn(int newFoldColumn)
Set the value of FoldColumn. |
void |
setInstances(Instances newInstances)
Set the value of Instances. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setProduceLatex(boolean l)
Set whether latex is output |
void |
setResultsetKeyColumns(Range newResultsetKeyColumns)
Set the value of ResultsetKeyColumns. |
void |
setRunColumn(int newRunColumn)
Set the value of RunColumn. |
void |
setShowStdDevs(boolean s)
Set whether standard deviations are displayed or not. |
void |
setSignificanceLevel(double newSignificanceLevel)
Set the value of SignificanceLevel. |
protected java.lang.String |
templateString(Instance template)
Returns a string descriptive of the key column values for the "datasets |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Instances m_Instances
protected int m_RunColumn
protected int m_RunColumnSet
protected int m_FoldColumn
protected double m_SignificanceLevel
protected Range m_DatasetKeyColumnsRange
protected int[] m_DatasetKeyColumns
protected PairedTTester.DatasetSpecifiers m_DatasetSpecifiers
protected Range m_ResultsetKeyColumnsRange
protected int[] m_ResultsetKeyColumns
protected FastVector m_Resultsets
protected boolean m_ResultsetsValid
protected boolean m_ShowStdDevs
protected boolean m_latexOutput
Constructor Detail |
public PairedTTester()
Method Detail |
protected java.lang.String templateString(Instance template)
template
- the template
public void setProduceLatex(boolean l)
l
- true if tables are to be produced in Latex formatpublic boolean getProduceLatex()
public void setShowStdDevs(boolean s)
s
- true if standard deviations are to be displayedpublic boolean getShowStdDevs()
protected void prepareData() throws java.lang.Exception
java.lang.Exception
- if the TTest parameters have not been set.public int getNumDatasets()
public int getNumResultsets()
public java.lang.String getResultsetName(int index)
index
- the index of the resultset
public PairedStats calculateStatistics(Instance datasetSpecifier, int resultset1Index, int resultset2Index, int comparisonColumn) throws java.lang.Exception
datasetSpecifier
- the dataset specifierresultset1Index
- the index of the first resultsetresultset2Index
- the index of the second resultsetcomparisonColumn
- the column containing values to compare
java.lang.Exception
- if an error occurspublic java.lang.String resultsetKey()
public java.lang.String header(int comparisonColumn)
comparisonColumn
- a value of type 'int'
public int[][] multiResultsetWins(int comparisonColumn) throws java.lang.Exception
comparisonColumn
- the index of the comparison column
java.lang.Exception
- if an error occurspublic java.lang.String multiResultsetSummary(int comparisonColumn) throws java.lang.Exception
comparisonColumn
- the index of the comparison column
java.lang.Exception
- if an error occurspublic java.lang.String multiResultsetRanking(int comparisonColumn) throws java.lang.Exception
java.lang.Exception
private java.lang.String multiResultsetFullLatex(int baseResultset, int comparisonColumn, int maxWidthMean, int maxWidthStdDev)
baseResultset
- the index of the base resultsetcomparisonColumn
- the index of the column to compare overmaxWidthMean
- width for the meanmaxWidthStdDev
- width for the standard deviation
private java.lang.String multiResultsetFullPlainText(int baseResultset, int comparisonColumn, int maxWidthMean, int maxWidthStdDev)
baseResultset
- the index of the base resultsetcomparisonColumn
- the index of the column to compare overmaxWidthMean
- width for the meanmaxWidthStdDev
- width for the standard deviation
public java.lang.String multiResultsetFull(int baseResultset, int comparisonColumn) throws java.lang.Exception
baseResultset
- the index of the base resultsetcomparisonColumn
- the index of the column to compare over
java.lang.Exception
- if an error occurspublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-D num,num2...
The column numbers that uniquely specify a dataset.
(default last)
-R num
The column number containing the run number.
(default last)
-F num
The column number containing the fold number.
(default none)
-S num
The significance level for T-Tests.
(default 0.05)
-G 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
setOptions
in interface OptionHandler
options
- an array containing options to set.
java.lang.Exception
- if invalid options are givenpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public Range getResultsetKeyColumns()
public void setResultsetKeyColumns(Range newResultsetKeyColumns)
newResultsetKeyColumns
- Value to assign to ResultsetKeyColumns.public double getSignificanceLevel()
public void setSignificanceLevel(double newSignificanceLevel)
newSignificanceLevel
- Value to assign to SignificanceLevel.public Range getDatasetKeyColumns()
public void setDatasetKeyColumns(Range newDatasetKeyColumns)
newDatasetKeyColumns
- Value to assign to DatasetKeyColumns.public int getRunColumn()
public void setRunColumn(int newRunColumn)
newRunColumn
- Value to assign to RunColumn.public int getFoldColumn()
public void setFoldColumn(int newFoldColumn)
newFoldColumn
- Value to assign to FoldColumn.public Instances getInstances()
public void setInstances(Instances newInstances)
newInstances
- Value to assign to Instances.public static void main(java.lang.String[] args)
args
- contains options for the instance ttests
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |