org.knime.base.node.mine.scorer.accuracy
Class ConfusionTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.knime.base.node.mine.scorer.accuracy.ConfusionTableModel
All Implemented Interfaces:
Serializable, TableModel

public class ConfusionTableModel
extends AbstractTableModel

A table model representing a confusion matrix.

Author:
Christoph Sieb, University of Konstanz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ConfusionTableModel(int[][] scoreCount, String[] headers, String rowHeaderDescription, String columnHeaderDescription)
          Constructs confusion table model from the score count and the headers.
 
Method Summary
 int getColumnCount()
          Column and row count are equal as this is a square matrix.
 String getColumnName(int column)
          Returns the column names, i.e.
 int getRowCount()
          Column and row count are equal as this is a square matrix.
 Object getValueAt(int rowIndex, int columnIndex)
          Returns the confusion matrix value at the corresponding position.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfusionTableModel

public ConfusionTableModel(int[][] scoreCount,
                           String[] headers,
                           String rowHeaderDescription,
                           String columnHeaderDescription)
Constructs confusion table model from the score count and the headers.

Parameters:
scoreCount - a 2-D int array representing the confusion matrix.
headers - the names of the attributes to display in the table
rowHeaderDescription - row header description
columnHeaderDescription - column header description
Method Detail

getColumnCount

public int getColumnCount()
Column and row count are equal as this is a square matrix. Note: + 1 for the column header


getRowCount

public int getRowCount()
Column and row count are equal as this is a square matrix. Note: + 1 for the row header


getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Returns the confusion matrix value at the corresponding position. Note: the first column contains like the column names also the attribute names.


getColumnName

public String getColumnName(int column)
Returns the column names, i.e. the attribute names of the confusion matrix.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
column - the index of the column in the table to display
Returns:
the column (attribute) name for the given column index


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.