Class AnalogicalModelingOutput
- java.lang.Object
-
- weka.classifiers.evaluation.output.prediction.AbstractOutput
-
- weka.classifiers.evaluation.output.prediction.AnalogicalModelingOutput
-
- All Implemented Interfaces:
java.io.Serializable
,weka.core.OptionHandler
public class AnalogicalModelingOutput extends weka.classifiers.evaluation.output.prediction.AbstractOutput
This class implements a classification output scheme specific to the Analogical Modeling classifier. In particular, it allows the user to print gang effects and analogical sets. Valid options are:-p <range> The range of attributes to print in addition to the classification. (default: none)
-distribution Whether to turn on the output of the class distribution. Only for nominal class attributes. (default: off)
-decimals <num> The number of digits after the decimal point. (default: 3)
-file <path> The file to store the output in, instead of outputting it on stdout. Gets ignored if the supplied path is a directory. (default: .)
-suppress In case the data gets stored in a file, then this flag can be used to suppress the regular output. (default: not suppressed)
-summary Output short summary statistics
-as Output the analogical set
-gang Output gang effects
-F <format> Format to print reports in. The options are 'human' and 'csv'. 'human' output is a human-readable, text-based table of some kind. 'csv', or comma-separated values, is intended to be machine-readable (for loading in Excel, Pandas, etc.), and contains strictly more data, such as the configuration parameters. Default is 'human'. If summary printing is turned on, this is always printed in the human-readable format.
This output module enables detailed reporting on the results of the Analogical Modeling classifier, such as the analogical set and gang effects.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static weka.core.Tag[]
TAGS_FORMATTER
Define possible formatting methods
-
Constructor Summary
Constructors Constructor Description AnalogicalModelingOutput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
analogicalSetTipText()
Returns the tip text for this property.protected void
doPrintClassification(double[] classDistribution, weka.core.Instance classifiedInstance, int index)
protected void
doPrintClassification(weka.classifiers.Classifier classifier, weka.core.Instance inst, int index)
Make sure to callsetHeader
first, or this will throw a NullPointerException.protected void
doPrintFooter()
protected void
doPrintHeader()
java.lang.String
gangsTipText()
Returns the tip text for this property.boolean
getAnalogicalSet()
java.lang.String
getDisplay()
weka.core.SelectedTag
getFormat()
boolean
getGangs()
java.lang.String[]
getOptions()
Gets the current option settings for the OptionHandler.boolean
getSummary()
java.lang.String
globalInfo()
java.util.Enumeration<weka.core.Option>
listOptions()
Returns an enumeration of all the available options..void
printClassification(weka.classifiers.Classifier classifier, weka.core.Instance inst, int index)
This is the function that is called in the GUI (ClassifierPanel); it has to be overridden here because the implementation inAbstractOutput
callsdoPrintClassification(double[], Instance, int)
insteadvoid
setAnalogicalSet(boolean value)
void
setFormat(weka.core.SelectedTag newMode)
void
setGangs(boolean value)
void
setOptions(java.lang.String[] options)
Sets the OptionHandler's options using the given list.void
setSummary(boolean value)
java.lang.String
summaryTipText()
Returns the tip text for this property.-
Methods inherited from class weka.classifiers.evaluation.output.prediction.AbstractOutput
append, attributesTipText, checkBasic, checkHeader, fromCommandline, generatesOutput, getAttributes, getBuffer, getDefaultNumDecimals, getHeader, getNumDecimals, getOutputDistribution, getOutputFile, getSuppressOutput, numDecimalsTipText, outputDistributionTipText, outputFileTipText, preProcessInstance, print, print, printClassification, printClassifications, printClassifications, printFooter, printHeader, setAttributes, setBuffer, setHeader, setNumDecimals, setOutputDistribution, setOutputFile, setSuppressOutput, suppressOutputTipText
-
-
-
-
Method Detail
-
getFormat
public weka.core.SelectedTag getFormat()
- Returns:
- Selected formatter
-
setFormat
public void setFormat(weka.core.SelectedTag newMode)
- Parameters:
newMode
- tag indicating which formatter to use- Throws:
java.lang.IllegalArgumentException
- if input is not a known formatter.
-
globalInfo
public java.lang.String globalInfo()
- Specified by:
globalInfo
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
getDisplay
public java.lang.String getDisplay()
- Specified by:
getDisplay
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
doPrintHeader
protected void doPrintHeader()
- Specified by:
doPrintHeader
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
printClassification
public void printClassification(weka.classifiers.Classifier classifier, weka.core.Instance inst, int index) throws java.lang.Exception
This is the function that is called in the GUI (ClassifierPanel); it has to be overridden here because the implementation inAbstractOutput
callsdoPrintClassification(double[], Instance, int)
instead- Overrides:
printClassification
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
- Throws:
java.lang.Exception
-
doPrintClassification
protected void doPrintClassification(weka.classifiers.Classifier classifier, weka.core.Instance inst, int index) throws java.lang.Exception
Make sure to callsetHeader
first, or this will throw a NullPointerException.- Specified by:
doPrintClassification
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
- Throws:
java.lang.Exception
-
doPrintClassification
protected void doPrintClassification(double[] classDistribution, weka.core.Instance classifiedInstance, int index)
- Specified by:
doPrintClassification
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
doPrintFooter
protected void doPrintFooter()
- Specified by:
doPrintFooter
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
listOptions
public java.util.Enumeration<weka.core.Option> listOptions()
Returns an enumeration of all the available options..- Specified by:
listOptions
in interfaceweka.core.OptionHandler
- Overrides:
listOptions
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
- Returns:
- an enumeration of all available options.
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).Valid options are:
-p <range> The range of attributes to print in addition to the classification. (default: none)
-distribution Whether to turn on the output of the class distribution. Only for nominal class attributes. (default: off)
-decimals <num> The number of digits after the decimal point. (default: 3)
-file <path> The file to store the output in, instead of outputting it on stdout. Gets ignored if the supplied path is a directory. (default: .)
-suppress In case the data gets stored in a file, then this flag can be used to suppress the regular output. (default: not suppressed)
-summary Output short summary statistics
-as Output the analogical set
-gang Output gang effects
-F <format> Format to print reports in. The options are 'human' and 'csv'. 'human' output is a human-readable, text-based table of some kind. 'csv', or comma-separated values, is intended to be machine-readable (for loading in Excel, Pandas, etc.), and contains strictly more data, such as the configuration parameters. Default is 'human'. If summary printing is turned on, this is always printed in the human-readable format.
*
- Specified by:
setOptions
in interfaceweka.core.OptionHandler
- Overrides:
setOptions
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
- Parameters:
options
- the list of options as an array of strings- Throws:
java.lang.Exception
- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Gets the current option settings for the OptionHandler.- Specified by:
getOptions
in interfaceweka.core.OptionHandler
- Overrides:
getOptions
in classweka.classifiers.evaluation.output.prediction.AbstractOutput
- Returns:
- the list of current option settings as an array of strings
-
setGangs
public void setGangs(boolean value)
- Parameters:
value
- whether gang effects will be printed
-
getGangs
public boolean getGangs()
- Returns:
- whether gang effects will be printed
-
gangsTipText
public java.lang.String gangsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI
-
setSummary
public void setSummary(boolean value)
- Parameters:
value
- whether a summary is to be printed
-
getSummary
public boolean getSummary()
- Returns:
- whether a summary will be printed
-
summaryTipText
public java.lang.String summaryTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI
-
getAnalogicalSet
public boolean getAnalogicalSet()
- Returns:
- true if the analogical set will be printed
-
setAnalogicalSet
public void setAnalogicalSet(boolean value)
- Parameters:
value
- True if the analogical set should be printed
-
analogicalSetTipText
public java.lang.String analogicalSetTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI
-
-