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.AbstractOutputThis 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_FORMATTERDefine possible formatting methods
-
Constructor Summary
Constructors Constructor Description AnalogicalModelingOutput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringanalogicalSetTipText()Returns the tip text for this property.protected voiddoPrintClassification(double[] classDistribution, weka.core.Instance classifiedInstance, int index)protected voiddoPrintClassification(weka.classifiers.Classifier classifier, weka.core.Instance inst, int index)Make sure to callsetHeaderfirst, or this will throw a NullPointerException.protected voiddoPrintFooter()protected voiddoPrintHeader()java.lang.StringgangsTipText()Returns the tip text for this property.booleangetAnalogicalSet()java.lang.StringgetDisplay()weka.core.SelectedTaggetFormat()booleangetGangs()java.lang.String[]getOptions()Gets the current option settings for the OptionHandler.booleangetSummary()java.lang.StringglobalInfo()java.util.Enumeration<weka.core.Option>listOptions()Returns an enumeration of all the available options..voidprintClassification(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 inAbstractOutputcallsdoPrintClassification(double[], Instance, int)insteadvoidsetAnalogicalSet(boolean value)voidsetFormat(weka.core.SelectedTag newMode)voidsetGangs(boolean value)voidsetOptions(java.lang.String[] options)Sets the OptionHandler's options using the given list.voidsetSummary(boolean value)java.lang.StringsummaryTipText()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:
globalInfoin classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
getDisplay
public java.lang.String getDisplay()
- Specified by:
getDisplayin classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
doPrintHeader
protected void doPrintHeader()
- Specified by:
doPrintHeaderin classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
printClassification
public void printClassification(weka.classifiers.Classifier classifier, weka.core.Instance inst, int index) throws java.lang.ExceptionThis is the function that is called in the GUI (ClassifierPanel); it has to be overridden here because the implementation inAbstractOutputcallsdoPrintClassification(double[], Instance, int)instead- Overrides:
printClassificationin 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.ExceptionMake sure to callsetHeaderfirst, or this will throw a NullPointerException.- Specified by:
doPrintClassificationin classweka.classifiers.evaluation.output.prediction.AbstractOutput- Throws:
java.lang.Exception
-
doPrintClassification
protected void doPrintClassification(double[] classDistribution, weka.core.Instance classifiedInstance, int index)- Specified by:
doPrintClassificationin classweka.classifiers.evaluation.output.prediction.AbstractOutput
-
doPrintFooter
protected void doPrintFooter()
- Specified by:
doPrintFooterin 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:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin classweka.classifiers.evaluation.output.prediction.AbstractOutput- Returns:
- an enumeration of all available options.
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.ExceptionSets 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:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin 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:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin 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
-
-