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:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.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 adams.gui.core.spreadsheettable.CellRenderingCustomizer
m_CellRenderingCustomizer
for highlighting the cells in the table.protected adams.flow.transformer.ConfusionMatrix.MatrixValues
m_MatrixValues
what values to generate.protected int
m_NumDecimals
the number of decimals to use.protected boolean
m_UseProbabilities
whether to use the probabilities rather 0 and 1.
-
Constructor Summary
Constructors Constructor Description ConfusionMatrix()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canGenerateOutput(ResultItem item)
Checks whether output can be generated from this item.String
cellRenderingCustomizerTipText()
Returns the tip text for this property.protected TableContentPanel
createOutput(weka.classifiers.Evaluation eval, adams.core.MessageCollection errors)
Generates the table with the confusion matrix.void
defineOptions()
Adds options to the internal list of options.adams.gui.core.spreadsheettable.CellRenderingCustomizer
getCellRenderingCustomizer()
Returns the cell rendering customizer.adams.flow.transformer.ConfusionMatrix.MatrixValues
getMatrixValues()
Returns the type of values to generate.int
getNumDecimals()
Returns the currently set number of decimals.String
getTitle()
The title to use for the tab.boolean
getUseProbabilities()
Returns whether to use probabilities instead of 0 and 1 for the counts.String
globalInfo()
Returns a string describing the object.String
matrixValuesTipText()
Returns the tip text for this property.String
numDecimalsTipText()
Returns the tip text for this property.void
setCellRenderingCustomizer(adams.gui.core.spreadsheettable.CellRenderingCustomizer value)
Sets the cell rendering customizer.void
setMatrixValues(adams.flow.transformer.ConfusionMatrix.MatrixValues value)
Sets the type of values to generate.void
setNumDecimals(int value)
Sets the number of decimals to display.void
setUseProbabilities(boolean value)
Sets whether to use probabilities instead of 0 and 1 for the counts.String
useProbabilitiesTipText()
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
-
-
-
-
Field Detail
-
m_MatrixValues
protected adams.flow.transformer.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 adams.gui.core.spreadsheettable.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:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setMatrixValues
public void setMatrixValues(adams.flow.transformer.ConfusionMatrix.MatrixValues value)
Sets the type of values to generate.- Parameters:
value
- the type of values
-
getMatrixValues
public adams.flow.transformer.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(adams.gui.core.spreadsheettable.CellRenderingCustomizer value)
Sets the cell rendering customizer.- Parameters:
value
- the customizer
-
getCellRenderingCustomizer
public adams.gui.core.spreadsheettable.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:
getTitle
in classAbstractOutputGenerator<ResultItem>
- Returns:
- the title
-
canGenerateOutput
public boolean canGenerateOutput(ResultItem item)
Checks whether output can be generated from this item.- Specified by:
canGenerateOutput
in classAbstractOutputGenerator<ResultItem>
- Parameters:
item
- the item to check- Returns:
- true if output can be generated
-
createOutput
protected TableContentPanel createOutput(weka.classifiers.Evaluation eval, adams.core.MessageCollection errors)
Generates the table with the confusion matrix.- Specified by:
createOutput
in classAbstractOutputGeneratorWithSeparateFoldsSupport<TableContentPanel>
- Parameters:
eval
- the evaluation to use as basiserrors
- for collecting errors- Returns:
- the generated table, null if failed to generate
-
-