weka.experiment
Class ResultMatrixMediaWiki

java.lang.Object
  extended by weka.experiment.ResultMatrix
      extended by weka.experiment.ResultMatrixMediaWiki
All Implemented Interfaces:
Serializable, weka.core.OptionHandler, weka.core.RevisionHandler

public class ResultMatrixMediaWiki
extends weka.experiment.ResultMatrix

Generates table output in MediaWiki format.

Valid options are:

 -mean-prec <int>
  The number of decimals after the decimal point for the mean.
  (default: 2)
 -stddev-prec <int>
  The number of decimals after the decimal point for the mean.
  (default: 2)
 -col-name-width <int>
  The maximum width for the column names (0 = optimal).
  (default: 0)
 -row-name-width <int>
  The maximum width for the row names (0 = optimal).
  (default: 25)
 -mean-width <int>
  The width of the mean (0 = optimal).
  (default: 0)
 -stddev-width <int>
  The width of the standard deviation (0 = optimal).
  (default: 0)
 -sig-width <int>
  The width of the significance indicator (0 = optimal).
  (default: 0)
 -count-width <int>
  The width of the counts (0 = optimal).
  (default: 0)
 -show-stddev
  Whether to display the standard deviation column.
  (default: no)
 -show-avg
  Whether to show the row with averages.
  (default: no)
 -remove-filter
  Whether to remove the classname package prefixes from the
  filter names in datasets.
  (default: no)
 -print-col-names
  Whether to output column names or just numbers representing them.
  (default: no)
 -print-row-names
  Whether to output row names or just numbers representing them.
  (default: no)
 -enum-col-names
  Whether to enumerate the column names (prefixing them with
  '(x)', with 'x' being the index).
  (default: no)
 -enum-row-names
  Whether to enumerate the row names (prefixing them with
  '(x)', with 'x' being the index).
  (default: no)
 -border <int>
  The thickness of the table border.
  (default: 1)
 -cell-spacing <int>
  The cell spacing of the table.
  (default: 0)
 -cell-padding <int>
  The cell padding of the table.
  (default: 5)

Version:
$Revision: 4521 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  int m_Border
          the size of the border.
protected  int m_CellPadding
          the cell padding.
protected  int m_CellSpacing
          the cell spacing.
 
Fields inherited from class weka.experiment.ResultMatrix
LEFT_PARENTHESES, LOSS_STRING, m_ColHidden, m_ColNames, m_ColNameWidth, m_ColOrder, m_Counts, m_CountWidth, m_EnumerateColNames, m_EnumerateRowNames, m_HeaderKeys, m_HeaderValues, m_Mean, m_MeanPrec, m_MeanWidth, m_NonSigWins, m_PrintColNames, m_PrintRowNames, m_RankingDiff, m_RankingLosses, m_RankingWins, m_RemoveFilterName, m_RowHidden, m_RowNames, m_RowNameWidth, m_RowOrder, m_ShowAverage, m_ShowStdDev, m_Significance, m_SignificanceWidth, m_StdDev, m_StdDevPrec, m_StdDevWidth, m_Wins, RIGHT_PARENTHESES, SIGNIFICANCE_LOSS, SIGNIFICANCE_TIE, SIGNIFICANCE_WIN, TIE_STRING, WIN_STRING
 
Constructor Summary
ResultMatrixMediaWiki()
          initializes the matrix as 1x1 matrix.
ResultMatrixMediaWiki(int cols, int rows)
          initializes the matrix with the given dimensions.
ResultMatrixMediaWiki(weka.experiment.ResultMatrix matrix)
          initializes the matrix with the values from the given matrix.
 
Method Summary
 String borderTipText()
          Returns the tip text for this property.
 String cellPaddingTipText()
          Returns the tip text for this property.
 String cellSpacingTipText()
          Returns the tip text for this property.
 int getBorder()
          Returns the thickness of the border.
 int getCellPadding()
          Returns the cell padding for the table.
 int getCellSpacing()
          Returns the cell spacing for the table.
protected  int getDefaultBorder()
          Returns the default border thickness of the table.
protected  int getDefaultCellPadding()
          Returns the default cell padding for the table.
protected  int getDefaultCellSpacing()
          Returns the default cell spacing for the table.
 boolean getDefaultEnumerateColNames()
          returns the default of whether column names are prefixed with the index.
 boolean getDefaultPrintColNames()
          returns the default of whether column names or numbers instead are printed.
 int getDefaultRowNameWidth()
          returns the default width for the row names.
 String getDisplayName()
          returns the name of the output format.
 String[] getOptions()
          Gets the current option settings for the OptionHandler.
 String getRevision()
          Returns the revision string.
protected  String getTableEpilog()
          Returns the epilog for a table.
protected  String getTableProlog()
          Returns the prolog of a table.
 String globalInfo()
          Returns a string describing the matrix.
 Enumeration listOptions()
          Returns an enumeration of all the available options..
static void main(String[] args)
          for testing only.
 void setBorder(int value)
          Sets the thickness of the border.
 void setCellPadding(int value)
          Sets the cell padding for the table.
 void setCellSpacing(int value)
          Sets the cell spacing for the table.
 void setOptions(String[] options)
          Sets the OptionHandler's options using the given list.
 String toStringHeader()
          returns the header of the matrix as a string.
 String toStringKey()
          returns a key for all the col names, for better readability if the names got cut off.
 String toStringMatrix()
          returns the matrix in CSV format.
 String toStringRanking()
          returns the ranking in a string representation.
 String toStringSummary()
          returns the summary as string.
 
Methods inherited from class weka.experiment.ResultMatrix
addHeader, assign, clear, clearHeader, clearRanking, clearSummary, colNameWidthTipText, countWidthTipText, doubleToString, enumerateColNamesTipText, enumerateRowNamesTipText, getAverage, getColCount, getColHidden, getColName, getColNameWidth, getColOrder, getColSize, getColSize, getCount, getCountWidth, getDefaultColNameWidth, getDefaultCountWidth, getDefaultEnumerateRowNames, getDefaultMeanPrec, getDefaultMeanWidth, getDefaultPrintRowNames, getDefaultRemoveFilterName, getDefaultShowAverage, getDefaultShowStdDev, getDefaultSignificanceWidth, getDefaultStdDevPrec, getDefaultStdDevWidth, getDisplayCol, getDisplayRow, getEnumerateColNames, getEnumerateRowNames, getHeader, getMean, getMeanPrec, getMeanWidth, getPrintColNames, getPrintRowNames, getRemoveFilterName, getRowCount, getRowHidden, getRowName, getRowNameWidth, getRowOrder, getShowAverage, getShowStdDev, getSignificance, getSignificanceCount, getSignificanceWidth, getStdDev, getStdDevPrec, getStdDevWidth, getSummaryTitle, getVisibleColCount, getVisibleRowCount, headerKeys, isAverage, isMean, isRowName, isSignificance, isStdDev, meanPrecTipText, meanWidthTipText, padString, padString, printColNamesTipText, printRowNamesTipText, removeFilterName, removeFilterNameTipText, rowNameWidthTipText, setColHidden, setColName, setColNameWidth, setColOrder, setCount, setCountWidth, setEnumerateColNames, setEnumerateRowNames, setMean, setMeanPrec, setMeanWidth, setPrintColNames, setPrintRowNames, setRanking, setRemoveFilterName, setRowHidden, setRowName, setRowNameWidth, setRowOrder, setShowAverage, setShowStdDev, setSignificance, setSignificanceWidth, setSize, setStdDev, setStdDevPrec, setStdDevWidth, setSummary, showAverageTipText, showStdDevTipText, significanceWidthTipText, stdDevPrecTipText, stdDevWidthTipText, toArray, toString, trimString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Border

protected int m_Border
the size of the border.


m_CellSpacing

protected int m_CellSpacing
the cell spacing.


m_CellPadding

protected int m_CellPadding
the cell padding.

Constructor Detail

ResultMatrixMediaWiki

public ResultMatrixMediaWiki()
initializes the matrix as 1x1 matrix.


ResultMatrixMediaWiki

public ResultMatrixMediaWiki(int cols,
                             int rows)
initializes the matrix with the given dimensions.

Parameters:
cols - the number of columns
rows - the number of rows

ResultMatrixMediaWiki

public ResultMatrixMediaWiki(weka.experiment.ResultMatrix matrix)
initializes the matrix with the values from the given matrix.

Parameters:
matrix - the matrix to get the values from
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the matrix.

Specified by:
globalInfo in class weka.experiment.ResultMatrix
Returns:
a description suitable for displaying in the experimenter gui

listOptions

public Enumeration listOptions()
Returns an enumeration of all the available options..

Specified by:
listOptions in interface weka.core.OptionHandler
Overrides:
listOptions in class weka.experiment.ResultMatrix
Returns:
an enumeration of all available options.

setOptions

public void setOptions(String[] options)
                throws Exception
Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).

Specified by:
setOptions in interface weka.core.OptionHandler
Overrides:
setOptions in class weka.experiment.ResultMatrix
Parameters:
options - the list of options as an array of strings
Throws:
Exception - if an option is not supported

getOptions

public String[] getOptions()
Gets the current option settings for the OptionHandler.

Specified by:
getOptions in interface weka.core.OptionHandler
Overrides:
getOptions in class weka.experiment.ResultMatrix
Returns:
the list of current option settings as an array of strings

getDisplayName

public String getDisplayName()
returns the name of the output format.

Specified by:
getDisplayName in class weka.experiment.ResultMatrix
Returns:
the display name

getDefaultRowNameWidth

public int getDefaultRowNameWidth()
returns the default width for the row names.

Overrides:
getDefaultRowNameWidth in class weka.experiment.ResultMatrix
Returns:
the width

getDefaultPrintColNames

public boolean getDefaultPrintColNames()
returns the default of whether column names or numbers instead are printed.

Overrides:
getDefaultPrintColNames in class weka.experiment.ResultMatrix
Returns:
true if names instead of numbers are printed

getDefaultEnumerateColNames

public boolean getDefaultEnumerateColNames()
returns the default of whether column names are prefixed with the index.

Overrides:
getDefaultEnumerateColNames in class weka.experiment.ResultMatrix
Returns:
true if the names are prefixed

getDefaultBorder

protected int getDefaultBorder()
Returns the default border thickness of the table.

Returns:
the default thickness

setBorder

public void setBorder(int value)
Sets the thickness of the border.

Parameters:
value - the thickness

getBorder

public int getBorder()
Returns the thickness of the border.

Returns:
the thickness

borderTipText

public String borderTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the experimenter gui

getDefaultCellSpacing

protected int getDefaultCellSpacing()
Returns the default cell spacing for the table.

Returns:
the default cell spacing

setCellSpacing

public void setCellSpacing(int value)
Sets the cell spacing for the table.

Parameters:
value - the cell spacing

getCellSpacing

public int getCellSpacing()
Returns the cell spacing for the table.

Returns:
the cell spacing

cellSpacingTipText

public String cellSpacingTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the experimenter gui

getDefaultCellPadding

protected int getDefaultCellPadding()
Returns the default cell padding for the table.

Returns:
the default cell padding

setCellPadding

public void setCellPadding(int value)
Sets the cell padding for the table.

Parameters:
value - the cell padding

getCellPadding

public int getCellPadding()
Returns the cell padding for the table.

Returns:
the cell padding

cellPaddingTipText

public String cellPaddingTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the experimenter gui

getTableProlog

protected String getTableProlog()
Returns the prolog of a table.

Returns:
the prolog

getTableEpilog

protected String getTableEpilog()
Returns the epilog for a table.

Returns:
the epilog

toStringHeader

public String toStringHeader()
returns the header of the matrix as a string.

Specified by:
toStringHeader in class weka.experiment.ResultMatrix
Returns:
the header
See Also:
ResultMatrix.m_HeaderKeys, ResultMatrix.m_HeaderValues

toStringMatrix

public String toStringMatrix()
returns the matrix in CSV format.

Specified by:
toStringMatrix in class weka.experiment.ResultMatrix
Returns:
the matrix as string

toStringKey

public String toStringKey()
returns a key for all the col names, for better readability if the names got cut off.

Specified by:
toStringKey in class weka.experiment.ResultMatrix
Returns:
the key

toStringSummary

public String toStringSummary()
returns the summary as string.

Specified by:
toStringSummary in class weka.experiment.ResultMatrix
Returns:
the summary

toStringRanking

public String toStringRanking()
returns the ranking in a string representation.

Specified by:
toStringRanking in class weka.experiment.ResultMatrix
Returns:
the ranking

getRevision

public String getRevision()
Returns the revision string.

Returns:
the revision

main

public static void main(String[] args)
for testing only.

Parameters:
args - ignored


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.