Class ConfusionMatrix
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.wekainvestigator.output.AbstractOutputGenerator<ResultItem>
-
- adams.gui.tools.wekainvestigator.tab.classifytab.output.AbstractOutputGenerator
-
- adams.gui.tools.wekainvestigator.tab.classifytab.output.AbstractOutputGeneratorWithSeparateFoldsSupport<TableContentPanel>
-
- adams.gui.tools.wekainvestigator.tab.classifytab.output.ConfusionMatrix
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Serializable
public class ConfusionMatrix extends AbstractOutputGeneratorWithSeparateFoldsSupport<TableContentPanel>
Displays the confusion matrix.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CellRenderingCustomizerm_CellRenderingCustomizerfor highlighting the cells in the table.protected ConfusionMatrix.MatrixValuesm_MatrixValueswhat values to generate.protected intm_NumDecimalsthe number of decimals to use.protected booleanm_UseProbabilitieswhether to use the probabilities rather 0 and 1.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ConfusionMatrix()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanGenerateOutput(ResultItem item)Checks whether output can be generated from this item.StringcellRenderingCustomizerTipText()Returns the tip text for this property.protected TableContentPanelcreateOutput(ResultItem item, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, MessageCollection errors)Generates the output for the evaluation.voiddefineOptions()Adds options to the internal list of options.CellRenderingCustomizergetCellRenderingCustomizer()Returns the cell rendering customizer.ConfusionMatrix.MatrixValuesgetMatrixValues()Returns the type of values to generate.intgetNumDecimals()Returns the currently set number of decimals. -1 if displaying all.StringgetTitle()The title to use for the tab.booleangetUseProbabilities()Returns whether to use probabilities instead of 0 and 1 for the counts.StringglobalInfo()Returns a string describing the object.StringmatrixValuesTipText()Returns the tip text for this property.StringnumDecimalsTipText()Returns the tip text for this property.voidsetCellRenderingCustomizer(CellRenderingCustomizer value)Sets the cell rendering customizer.voidsetMatrixValues(ConfusionMatrix.MatrixValues value)Sets the type of values to generate.voidsetNumDecimals(int value)Sets the number of decimals to display.voidsetUseProbabilities(boolean value)Sets whether to use probabilities instead of 0 and 1 for the counts.StringuseProbabilitiesTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.classifytab.output.AbstractOutputGeneratorWithSeparateFoldsSupport
createOutput
-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.classifytab.output.AbstractOutputGenerator
addPage, newMultiPagePane
-
Methods inherited from class adams.gui.tools.wekainvestigator.output.AbstractOutputGenerator
addTab, generateOutput
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_MatrixValues
protected ConfusionMatrix.MatrixValues m_MatrixValues
what values to generate.
-
m_UseProbabilities
protected boolean m_UseProbabilities
whether to use the probabilities rather 0 and 1.
-
m_CellRenderingCustomizer
protected CellRenderingCustomizer m_CellRenderingCustomizer
for highlighting the cells in the table.
-
m_NumDecimals
protected int m_NumDecimals
the number of decimals to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setMatrixValues
public void setMatrixValues(ConfusionMatrix.MatrixValues value)
Sets the type of values to generate.- Parameters:
value- the type of values
-
getMatrixValues
public ConfusionMatrix.MatrixValues getMatrixValues()
Returns the type of values to generate.- Returns:
- the type of values
-
matrixValuesTipText
public String matrixValuesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseProbabilities
public void setUseProbabilities(boolean value)
Sets whether to use probabilities instead of 0 and 1 for the counts.- Parameters:
value- true if to use probabilities
-
getUseProbabilities
public boolean getUseProbabilities()
Returns whether to use probabilities instead of 0 and 1 for the counts.- Returns:
- true if to use probabilities
-
useProbabilitiesTipText
public String useProbabilitiesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCellRenderingCustomizer
public void setCellRenderingCustomizer(CellRenderingCustomizer value)
Sets the cell rendering customizer.- Parameters:
value- the customizer
-
getCellRenderingCustomizer
public CellRenderingCustomizer getCellRenderingCustomizer()
Returns the cell rendering customizer.- Returns:
- the customizer
-
cellRenderingCustomizerTipText
public String cellRenderingCustomizerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumDecimals
public void setNumDecimals(int value)
Sets the number of decimals to display. Use -1 to display all.- Parameters:
value- the number of decimals
-
getNumDecimals
public int getNumDecimals()
Returns the currently set number of decimals. -1 if displaying all.- Returns:
- the number of decimals
-
numDecimalsTipText
public String numDecimalsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getTitle
public String getTitle()
The title to use for the tab.- Specified by:
getTitlein classAbstractOutputGenerator<ResultItem>- Returns:
- the title
-
canGenerateOutput
public boolean canGenerateOutput(ResultItem item)
Checks whether output can be generated from this item.- Specified by:
canGenerateOutputin classAbstractOutputGenerator<ResultItem>- Parameters:
item- the item to check- Returns:
- true if output can be generated
-
createOutput
protected TableContentPanel createOutput(ResultItem item, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, MessageCollection errors)
Generates the output for the evaluation.- Specified by:
createOutputin classAbstractOutputGeneratorWithSeparateFoldsSupport<TableContentPanel>- Parameters:
item- the item to generate output foreval- the evaluation to use as basisoriginalIndices- the original indices to use, can be nulladditionalAttributes- the additional attributes to display, can be nullerrors- for collecting errors- Returns:
- the generated table, null if failed to generate
-
-