Class ResultMatrixAdamsCSV

  • All Implemented Interfaces:
    Serializable, weka.core.OptionHandler, weka.core.RevisionHandler

    public class ResultMatrixAdamsCSV
    extends weka.experiment.ResultMatrix
    Generates the matrix in ADAMS CSV ('comma-separated values') 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: 0)
     -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)
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      • 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
      ResultMatrixAdamsCSV()
      initializes the matrix as 1x1 matrix.
      ResultMatrixAdamsCSV​(int cols, int rows)
      initializes the matrix with the given dimensions.
      ResultMatrixAdamsCSV​(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
      void clear()
      removes the stored data but retains the dimensions of the matrix.
      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.
      protected adams.data.io.output.CsvSpreadSheetWriter getDefaultWriter()
      Returns the default writer to use.
      String getDisplayName()
      returns the name of the output format.
      String getRevision()
      Returns the revision string.
      String globalInfo()
      Returns a string describing the matrix.
      static void main​(String[] args)
      for testing only.
      String[][] toArray()
      returns a 2-dimensional array with the prepared data.
      protected String toString​(adams.data.spreadsheet.SpreadSheet sheet)
      Turns the spreadsheet into a string.
      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, 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, getOptions, 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, listOptions, meanPrecTipText, meanWidthTipText, padString, padString, printColNamesTipText, printRowNamesTipText, removeFilterName, removeFilterNameTipText, rowNameWidthTipText, setColHidden, setColName, setColNameWidth, setColOrder, setCount, setCountWidth, setEnumerateColNames, setEnumerateRowNames, setMean, setMeanPrec, setMeanWidth, setOptions, setPrintColNames, setPrintRowNames, setRanking, setRemoveFilterName, setRowHidden, setRowName, setRowNameWidth, setRowOrder, setShowAverage, setShowStdDev, setSignificance, setSignificanceWidth, setSize, setStdDev, setStdDevPrec, setStdDevWidth, setSummary, showAverageTipText, showStdDevTipText, significanceWidthTipText, stdDevPrecTipText, stdDevWidthTipText, toString, trimString
    • Constructor Detail

      • ResultMatrixAdamsCSV

        public ResultMatrixAdamsCSV()
        initializes the matrix as 1x1 matrix.
      • ResultMatrixAdamsCSV

        public ResultMatrixAdamsCSV​(int cols,
                                    int rows)
        initializes the matrix with the given dimensions.
        Parameters:
        cols - the number of columns
        rows - the number of rows
      • ResultMatrixAdamsCSV

        public ResultMatrixAdamsCSV​(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
      • getDisplayName

        public String getDisplayName()
        returns the name of the output format.
        Specified by:
        getDisplayName in class weka.experiment.ResultMatrix
        Returns:
        the display name
      • clear

        public void clear()
        removes the stored data but retains the dimensions of the matrix.
        Overrides:
        clear in class weka.experiment.ResultMatrix
      • 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
      • toArray

        public String[][] toArray()
        returns a 2-dimensional array with the prepared data. includes the column and row names. hidden cols/rows are already excluded.
        first row: column names
        last row: wins/ties/losses
        first col: row names
        Overrides:
        toArray in class weka.experiment.ResultMatrix
        Returns:
        the generated array
      • getDefaultWriter

        protected adams.data.io.output.CsvSpreadSheetWriter getDefaultWriter()
        Returns the default writer to use.
        Returns:
        the writer
      • toString

        protected String toString​(adams.data.spreadsheet.SpreadSheet sheet)
        Turns the spreadsheet into a string.
        Parameters:
        sheet - the spreadsheet to convert
        Returns:
        the generated string
      • 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