程序包 weka.experiment

类 ResultMatrix

java.lang.Object
weka.experiment.ResultMatrix
所有已实现的接口:
Serializable, RevisionHandler
直接已知子类:
ResultMatrixCSV, ResultMatrixGnuPlot, ResultMatrixHTML, ResultMatrixLatex, ResultMatrixPlainText, ResultMatrixSignificance

public abstract class ResultMatrix extends Object implements Serializable, RevisionHandler
This matrix is a container for the datasets and classifier setups and their statistics. Derived classes output the data in different formats. Derived classes need to implement the following methods:
  • toStringMatrix()
  • toStringKey()
  • toStringHeader()
  • toStringSummary()
  • toStringRanking()
版本:
$Revision: 1.9 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    the left parentheses for enumerating cols/rows
    loss string
    the right parentheses for enumerating cols/rows
    static final int
    loss
    static final int
    tie
    static final int
    win
    tie string
    win string
  • 构造器概要

    构造器
    构造器
    说明
    initializes the matrix as 1x1 matrix
    ResultMatrix(int cols, int rows)
    initializes the matrix with the given dimensions
    initializes the matrix with the values from the given matrix
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    addHeader(String key, String value)
    adds the key-value pair to the header
    void
    acquires the data from the given matrix
    void
    removes the stored data and the ordering, but retains the dimensions of the matrix
    void
    removes all the header information
    void
    clears the currently stored ranking data
    void
    clears the current summary data
    double
    getAverage(int col)
    returns the average of the mean at the given position, if the position is valid, otherwise 0
    int
    returns the number of columns
    boolean
    getColHidden(int index)
    returns the hidden status of the column, if the index is valid, otherwise false
    getColName(int index)
    returns the name of the row, if the index is valid, otherwise null.
    int
    returns the current width for the column names
    int[]
    returns the current order of the columns, null means the default order
    double
    getCount(int index)
    returns the count for the row.
    int
    returns the current width for the counts
    int
    getDisplayCol(int index)
    returns the displayed index of the given col, depending on the order of columns, returns -1 if index out of bounds
    abstract String
    returns the name of the output format
    int
    getDisplayRow(int index)
    returns the displayed index of the given row, depending on the order of rows, returns -1 if index out of bounds
    boolean
    returns whether column names or numbers instead are enumerateed
    boolean
    returns whether row names or numbers instead are enumerateed
    returns the value associated with the given key, null if if cannot be found
    double
    getMean(int col, int row)
    returns the mean at the given position, if the position is valid, otherwise 0
    int
    returns the current precision for the means
    int
    returns the current width for the mean
    boolean
    returns whether column names or numbers instead are printed
    boolean
    returns whether row names or numbers instead are printed
    boolean
    returns whether the filter classname is removed from the dataset name
    int
    returns the number of rows
    boolean
    getRowHidden(int index)
    returns the hidden status of the row, if the index is valid, otherwise false
    getRowName(int index)
    returns the name of the row, if the index is valid, otherwise null.
    int
    returns the current width for the row names
    int[]
    returns the current order of the rows, null means the default order
    boolean
    returns whether average per column is displayed or not
    boolean
    returns whether std deviations are displayed or not
    int
    getSignificance(int col, int row)
    returns the significance at the given position, if the position is valid, otherwise SIGNIFICANCE_ATIE
    int
    getSignificanceCount(int col, int type)
    counts the occurrences of the given significance type in the given column.
    int
    returns the current width for the significance
    double
    getStdDev(int col, int row)
    returns the std deviation at the given position, if the position is valid, otherwise 0
    int
    returns the current standard deviation precision
    int
    returns the current width for the std dev
    int
    returns the number of visible columns
    int
    returns the number of visible rows
    returns an enumeration of the header keys
    void
    setColHidden(int index, boolean hidden)
    sets the hidden status of the column (if the index is valid)
    void
    setColName(int index, String name)
    sets the name of the column (if the index is valid)
    void
    setColNameWidth(int width)
    sets the width for the column names (0 = optimal)
    void
    setColOrder(int[] order)
    sets the ordering of the columns, null means default
    void
    setCount(int index, double count)
    sets the count for the row (if the index is valid)
    void
    setCountWidth(int width)
    sets the width for the counts (0 = optimal)
    void
    setEnumerateColNames(boolean enumerate)
    sets whether the column names are prefixed with "(x)" where "x" is the index
    void
    setEnumerateRowNames(boolean enumerate)
    sets whether to the row names or numbers instead are enumerateed
    void
    setMean(int col, int row, double value)
    sets the mean at the given position (if the position is valid)
    void
    setMeanPrec(int prec)
    sets the precision for the means
    void
    setMeanWidth(int width)
    sets the width for the mean (0 = optimal)
    void
    setPrintColNames(boolean print)
    sets whether the column names or numbers instead are printed.
    void
    setPrintRowNames(boolean print)
    sets whether the row names or numbers instead are printed deactivating automatically sets m_EnumerateColNames to TRUE.
    void
    setRanking(int[][] wins)
    sets the ranking data based on the wins
    void
    setRemoveFilterName(boolean remove)
    sets whether to remove the filter classname from the dataset name
    void
    setRowHidden(int index, boolean hidden)
    sets the hidden status of the row (if the index is valid)
    void
    setRowName(int index, String name)
    sets the name of the row (if the index is valid)
    void
    setRowNameWidth(int width)
    sets the width for the row names (0 = optimal)
    void
    setRowOrder(int[] order)
    sets the ordering of the rows, null means default
    void
    setShowAverage(boolean show)
    sets whether to display the average per column or not
    void
    setShowStdDev(boolean show)
    sets whether to display the std deviations or not
    void
    setSignificance(int col, int row, int value)
    sets the significance at the given position (if the position is valid)
    void
    sets the width for the significance (0 = optimal)
    void
    setSize(int cols, int rows)
    clears the content of the matrix and sets the new size
    void
    setStdDev(int col, int row, double value)
    sets the std deviation at the given position (if the position is valid)
    void
    setStdDevPrec(int prec)
    sets the precision for the standard deviation
    void
    setStdDevWidth(int width)
    sets the width for the std dev (0 = optimal)
    void
    setSummary(int[][] nonSigWins, int[][] wins)
    sets the non-significant and significant wins of the resultsets
    returns the matrix as a string
    abstract String
    returns the header of the matrix as a string
    abstract String
    returns returns a key for all the col names, for better readability if the names got cut off
    abstract String
    returns the matrix as a string
    abstract String
    returns the ranking in a string representation
    abstract String
    returns the summary as string

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    从接口继承的方法 weka.core.RevisionHandler

    getRevision
  • 字段详细资料

    • SIGNIFICANCE_TIE

      public static final int SIGNIFICANCE_TIE
      tie
      另请参阅:
    • SIGNIFICANCE_WIN

      public static final int SIGNIFICANCE_WIN
      win
      另请参阅:
    • SIGNIFICANCE_LOSS

      public static final int SIGNIFICANCE_LOSS
      loss
      另请参阅:
    • TIE_STRING

      public String TIE_STRING
      tie string
    • WIN_STRING

      public String WIN_STRING
      win string
    • LOSS_STRING

      public String LOSS_STRING
      loss string
    • LEFT_PARENTHESES

      public String LEFT_PARENTHESES
      the left parentheses for enumerating cols/rows
    • RIGHT_PARENTHESES

      public String RIGHT_PARENTHESES
      the right parentheses for enumerating cols/rows
  • 构造器详细资料

    • ResultMatrix

      public ResultMatrix()
      initializes the matrix as 1x1 matrix
    • ResultMatrix

      public ResultMatrix(int cols, int rows)
      initializes the matrix with the given dimensions
    • ResultMatrix

      public ResultMatrix(ResultMatrix matrix)
      initializes the matrix with the values from the given matrix
      参数:
      matrix - the matrix to get the values from
  • 方法详细资料

    • getDisplayName

      public abstract String getDisplayName()
      returns the name of the output format
    • assign

      public void assign(ResultMatrix matrix)
      acquires the data from the given matrix
    • clear

      public void clear()
      removes the stored data and the ordering, but retains the dimensions of the matrix
    • setSize

      public void setSize(int cols, int rows)
      clears the content of the matrix and sets the new size
      参数:
      cols - the number of mean columns
      rows - the number of mean rows
    • setMeanPrec

      public void setMeanPrec(int prec)
      sets the precision for the means
    • getMeanPrec

      public int getMeanPrec()
      returns the current precision for the means
    • setStdDevPrec

      public void setStdDevPrec(int prec)
      sets the precision for the standard deviation
    • getStdDevPrec

      public int getStdDevPrec()
      returns the current standard deviation precision
    • setColNameWidth

      public void setColNameWidth(int width)
      sets the width for the column names (0 = optimal)
    • getColNameWidth

      public int getColNameWidth()
      returns the current width for the column names
    • setRowNameWidth

      public void setRowNameWidth(int width)
      sets the width for the row names (0 = optimal)
    • getRowNameWidth

      public int getRowNameWidth()
      returns the current width for the row names
    • setMeanWidth

      public void setMeanWidth(int width)
      sets the width for the mean (0 = optimal)
    • getMeanWidth

      public int getMeanWidth()
      returns the current width for the mean
    • setStdDevWidth

      public void setStdDevWidth(int width)
      sets the width for the std dev (0 = optimal)
    • getStdDevWidth

      public int getStdDevWidth()
      returns the current width for the std dev
    • setSignificanceWidth

      public void setSignificanceWidth(int width)
      sets the width for the significance (0 = optimal)
    • getSignificanceWidth

      public int getSignificanceWidth()
      returns the current width for the significance
    • setCountWidth

      public void setCountWidth(int width)
      sets the width for the counts (0 = optimal)
    • getCountWidth

      public int getCountWidth()
      returns the current width for the counts
    • setShowStdDev

      public void setShowStdDev(boolean show)
      sets whether to display the std deviations or not
    • getShowStdDev

      public boolean getShowStdDev()
      returns whether std deviations are displayed or not
    • setShowAverage

      public void setShowAverage(boolean show)
      sets whether to display the average per column or not
    • getShowAverage

      public boolean getShowAverage()
      returns whether average per column is displayed or not
    • setRemoveFilterName

      public void setRemoveFilterName(boolean remove)
      sets whether to remove the filter classname from the dataset name
    • getRemoveFilterName

      public boolean getRemoveFilterName()
      returns whether the filter classname is removed from the dataset name
    • setPrintColNames

      public void setPrintColNames(boolean print)
      sets whether the column names or numbers instead are printed. deactivating automatically sets m_EnumerateColNames to TRUE.
      另请参阅:
    • getPrintColNames

      public boolean getPrintColNames()
      returns whether column names or numbers instead are printed
    • setPrintRowNames

      public void setPrintRowNames(boolean print)
      sets whether the row names or numbers instead are printed deactivating automatically sets m_EnumerateColNames to TRUE.
      另请参阅:
    • getPrintRowNames

      public boolean getPrintRowNames()
      returns whether row names or numbers instead are printed
    • setEnumerateColNames

      public void setEnumerateColNames(boolean enumerate)
      sets whether the column names are prefixed with "(x)" where "x" is the index
    • getEnumerateColNames

      public boolean getEnumerateColNames()
      returns whether column names or numbers instead are enumerateed
    • setEnumerateRowNames

      public void setEnumerateRowNames(boolean enumerate)
      sets whether to the row names or numbers instead are enumerateed
    • getEnumerateRowNames

      public boolean getEnumerateRowNames()
      returns whether row names or numbers instead are enumerateed
    • getColCount

      public int getColCount()
      returns the number of columns
    • getVisibleColCount

      public int getVisibleColCount()
      returns the number of visible columns
    • getRowCount

      public int getRowCount()
      returns the number of rows
    • getVisibleRowCount

      public int getVisibleRowCount()
      returns the number of visible rows
    • setColName

      public void setColName(int index, String name)
      sets the name of the column (if the index is valid)
      参数:
      index - the index of the column
      name - the name of the column
    • getColName

      public String getColName(int index)
      returns the name of the row, if the index is valid, otherwise null. if getPrintColNames() is FALSE then an empty string is returned or if getEnumerateColNames() is TRUE then the 1-based index surrounded by parentheses.
      另请参阅:
    • setRowName

      public void setRowName(int index, String name)
      sets the name of the row (if the index is valid)
      参数:
      index - the index of the row
      name - the name of the row
    • getRowName

      public String getRowName(int index)
      returns the name of the row, if the index is valid, otherwise null. if getPrintRowNames() is FALSE then an empty string is returned or if getEnumerateRowNames() is TRUE then the 1-based index surrounded by parentheses.
      另请参阅:
    • setColHidden

      public void setColHidden(int index, boolean hidden)
      sets the hidden status of the column (if the index is valid)
      参数:
      index - the index of the column
      hidden - the hidden status of the column
    • getColHidden

      public boolean getColHidden(int index)
      returns the hidden status of the column, if the index is valid, otherwise false
    • setRowHidden

      public void setRowHidden(int index, boolean hidden)
      sets the hidden status of the row (if the index is valid)
      参数:
      index - the index of the row
      hidden - the hidden status of the row
    • getRowHidden

      public boolean getRowHidden(int index)
      returns the hidden status of the row, if the index is valid, otherwise false
    • setCount

      public void setCount(int index, double count)
      sets the count for the row (if the index is valid)
      参数:
      index - the index of the row
      count - the count for the row
    • getCount

      public double getCount(int index)
      returns the count for the row. if the index is invalid then 0.
      参数:
      index - the index of the row
      返回:
      the count for the row
    • setMean

      public void setMean(int col, int row, double value)
      sets the mean at the given position (if the position is valid)
      参数:
      col - the column of the mean
      row - the row of the mean
      value - the value of the mean
    • getMean

      public double getMean(int col, int row)
      returns the mean at the given position, if the position is valid, otherwise 0
    • getAverage

      public double getAverage(int col)
      returns the average of the mean at the given position, if the position is valid, otherwise 0
    • setStdDev

      public void setStdDev(int col, int row, double value)
      sets the std deviation at the given position (if the position is valid)
      参数:
      col - the column of the std. deviation
      row - the row of the std deviation
      value - the value of the std deviation
    • getStdDev

      public double getStdDev(int col, int row)
      returns the std deviation at the given position, if the position is valid, otherwise 0
    • setSignificance

      public void setSignificance(int col, int row, int value)
      sets the significance at the given position (if the position is valid)
      参数:
      col - the column of the significance
      row - the row of the significance
      value - the value of the significance
    • getSignificance

      public int getSignificance(int col, int row)
      returns the significance at the given position, if the position is valid, otherwise SIGNIFICANCE_ATIE
    • getSignificanceCount

      public int getSignificanceCount(int col, int type)
      counts the occurrences of the given significance type in the given column.
      参数:
      col - the columnn to gather the information from
      type - the significance type, WIN/TIE/LOSS
    • setRowOrder

      public void setRowOrder(int[] order)
      sets the ordering of the rows, null means default
      参数:
      order - the new order of the rows
    • getRowOrder

      public int[] getRowOrder()
      returns the current order of the rows, null means the default order
      返回:
      the current order of the rows
    • getDisplayRow

      public int getDisplayRow(int index)
      returns the displayed index of the given row, depending on the order of rows, returns -1 if index out of bounds
      参数:
      index - the row to get the displayed index for
      返回:
      the real index of the row
    • setColOrder

      public void setColOrder(int[] order)
      sets the ordering of the columns, null means default
      参数:
      order - the new order of the columns
    • getColOrder

      public int[] getColOrder()
      returns the current order of the columns, null means the default order
      返回:
      the current order of the columns
    • getDisplayCol

      public int getDisplayCol(int index)
      returns the displayed index of the given col, depending on the order of columns, returns -1 if index out of bounds
      参数:
      index - the column to get the displayed index for
      返回:
      the real index of the column
    • toStringMatrix

      public abstract String toStringMatrix()
      returns the matrix as a string
    • toString

      public String toString()
      returns the matrix as a string
      覆盖:
      toString 在类中 Object
      另请参阅:
    • clearHeader

      public void clearHeader()
      removes all the header information
    • addHeader

      public void addHeader(String key, String value)
      adds the key-value pair to the header
      参数:
      key - the name of the header value
      value - the value of the header value
    • getHeader

      public String getHeader(String key)
      returns the value associated with the given key, null if if cannot be found
      参数:
      key - the key to retrieve the value for
      返回:
      the associated value
    • headerKeys

      public Enumeration headerKeys()
      returns an enumeration of the header keys
      返回:
      all stored keys
    • toStringHeader

      public abstract String toStringHeader()
      returns the header of the matrix as a string
      另请参阅:
      • m_HeaderKeys
      • m_HeaderValues
    • toStringKey

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

      public void clearSummary()
      clears the current summary data
    • setSummary

      public void setSummary(int[][] nonSigWins, int[][] wins)
      sets the non-significant and significant wins of the resultsets
      参数:
      nonSigWins - the non-significant wins
      wins - the significant wins
    • toStringSummary

      public abstract String toStringSummary()
      returns the summary as string
    • clearRanking

      public void clearRanking()
      clears the currently stored ranking data
    • setRanking

      public void setRanking(int[][] wins)
      sets the ranking data based on the wins
      参数:
      wins - the wins
    • toStringRanking

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