Package weka.experiment
Class ResultMatrixMediaWiki
- java.lang.Object
-
- weka.experiment.ResultMatrix
-
- weka.experiment.ResultMatrixMediaWiki
-
- All Implemented Interfaces:
Serializable,weka.core.OptionHandler,weka.core.RevisionHandler
public class ResultMatrixMediaWiki extends weka.experiment.ResultMatrixGenerates 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$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_Borderthe size of the border.protected intm_CellPaddingthe cell padding.protected intm_CellSpacingthe 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
Constructors Constructor Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringborderTipText()Returns the tip text for this property.StringcellPaddingTipText()Returns the tip text for this property.StringcellSpacingTipText()Returns the tip text for this property.intgetBorder()Returns the thickness of the border.intgetCellPadding()Returns the cell padding for the table.intgetCellSpacing()Returns the cell spacing for the table.protected intgetDefaultBorder()Returns the default border thickness of the table.protected intgetDefaultCellPadding()Returns the default cell padding for the table.protected intgetDefaultCellSpacing()Returns the default cell spacing for the table.booleangetDefaultEnumerateColNames()returns the default of whether column names are prefixed with the index.booleangetDefaultPrintColNames()returns the default of whether column names or numbers instead are printed.intgetDefaultRowNameWidth()returns the default width for the row names.StringgetDisplayName()returns the name of the output format.String[]getOptions()Gets the current option settings for the OptionHandler.StringgetRevision()Returns the revision string.protected StringgetTableEpilog()Returns the epilog for a table.protected StringgetTableProlog()Returns the prolog of a table.StringglobalInfo()Returns a string describing the matrix.EnumerationlistOptions()Returns an enumeration of all the available options..static voidmain(String[] args)for testing only.voidsetBorder(int value)Sets the thickness of the border.voidsetCellPadding(int value)Sets the cell padding for the table.voidsetCellSpacing(int value)Sets the cell spacing for the table.voidsetOptions(String[] options)Sets the OptionHandler's options using the given list.StringtoStringHeader()returns the header of the matrix as a string.StringtoStringKey()returns a key for all the col names, for better readability if the names got cut off.StringtoStringMatrix()returns the matrix in CSV format.StringtoStringRanking()returns the ranking in a string representation.StringtoStringSummary()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
-
-
-
-
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 columnsrows- 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:
globalInfoin classweka.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:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin classweka.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:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin classweka.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:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.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:
getDisplayNamein classweka.experiment.ResultMatrix- Returns:
- the display name
-
getDefaultRowNameWidth
public int getDefaultRowNameWidth()
returns the default width for the row names.- Overrides:
getDefaultRowNameWidthin classweka.experiment.ResultMatrix- Returns:
- the width
-
getDefaultPrintColNames
public boolean getDefaultPrintColNames()
returns the default of whether column names or numbers instead are printed.- Overrides:
getDefaultPrintColNamesin classweka.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:
getDefaultEnumerateColNamesin classweka.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:
toStringHeaderin classweka.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:
toStringMatrixin classweka.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:
toStringKeyin classweka.experiment.ResultMatrix- Returns:
- the key
-
toStringSummary
public String toStringSummary()
returns the summary as string.- Specified by:
toStringSummaryin classweka.experiment.ResultMatrix- Returns:
- the summary
-
toStringRanking
public String toStringRanking()
returns the ranking in a string representation.- Specified by:
toStringRankingin classweka.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
-
-