Package weka.classifiers.meta
Class SuppressModelOutput
- java.lang.Object
-
- weka.classifiers.AbstractClassifier
-
- weka.classifiers.SingleClassifierEnhancer
-
- weka.classifiers.meta.SuppressModelOutput
-
- All Implemented Interfaces:
Serializable,Cloneable,weka.classifiers.Classifier,weka.core.BatchPredictor,weka.core.CapabilitiesHandler,weka.core.CapabilitiesIgnorer,weka.core.CommandlineRunnable,ModelOutputHandler,weka.core.OptionHandler,weka.core.RevisionHandler
public class SuppressModelOutput extends weka.classifiers.SingleClassifierEnhancer implements ModelOutputHandler
Meta-classifier that enables the user to suppress the model output.
Useful for ensembles, since their output can be extremely long. Valid options are:-suppress-model-output If enabled, suppresses any large model output.
-W Full name of base classifier. (default: weka.classifiers.rules.ZeroR)
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
Options specific to classifier weka.classifiers.rules.ZeroR:
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_SuppressModelOutputwhether to suppress the model output.static StringSUPPRESS_MODEL_OUTPUT
-
Constructor Summary
Constructors Constructor Description SuppressModelOutput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClassifier(weka.core.Instances data)Builds the base classifier using the provided data.doubleclassifyInstance(weka.core.Instance instance)Classifies the given instance.double[]distributionForInstance(weka.core.Instance instance)Returns the class distribution for the given instance.String[]getOptions()Gets the current option settings for the OptionHandler.booleangetSuppressModelOutput()Returns whether to output the model with the toString() method or not.StringglobalInfo()Returns a string describing classifierEnumerationlistOptions()Returns an enumeration describing the available options.voidsetOptions(String[] options)Sets the OptionHandler's options using the given list.voidsetSuppressModelOutput(boolean value)Sets whether to output the model with the toString() method or not.StringsuppressModelOutputTipText()Returns the tip text for this property.StringtoString()Returns a string representation of the model.-
Methods inherited from class weka.classifiers.SingleClassifierEnhancer
classifierTipText, defaultClassifierOptions, defaultClassifierString, getCapabilities, getClassifier, getClassifierSpec, postExecution, preExecution, setClassifier
-
Methods inherited from class weka.classifiers.AbstractClassifier
batchSizeTipText, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, getRevision, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
-
-
-
Field Detail
-
SUPPRESS_MODEL_OUTPUT
public static final String SUPPRESS_MODEL_OUTPUT
- See Also:
- Constant Field Values
-
m_SuppressModelOutput
protected boolean m_SuppressModelOutput
whether to suppress the model output.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing classifier- Returns:
- a description suitable for displaying in the gui
-
setSuppressModelOutput
public void setSuppressModelOutput(boolean value)
Sets whether to output the model with the toString() method or not.- Specified by:
setSuppressModelOutputin interfaceModelOutputHandler- Parameters:
value- true if to suppress model output
-
getSuppressModelOutput
public boolean getSuppressModelOutput()
Returns whether to output the model with the toString() method or not.- Specified by:
getSuppressModelOutputin interfaceModelOutputHandler- Returns:
- the label index
-
suppressModelOutputTipText
public String suppressModelOutputTipText()
Returns the tip text for this property.- Specified by:
suppressModelOutputTipTextin interfaceModelOutputHandler- Returns:
- tip text for this property suitable for displaying in the gui
-
listOptions
public Enumeration listOptions()
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin classweka.classifiers.SingleClassifierEnhancer- Returns:
- an enumeration of all the available options.
-
setOptions
public void setOptions(String[] options) throws 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).- Specified by:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin classweka.classifiers.SingleClassifierEnhancer- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
public String[] getOptions()
Gets the current option settings for the OptionHandler.- Specified by:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.classifiers.SingleClassifierEnhancer- Returns:
- the list of current option settings as an array of strings
-
buildClassifier
public void buildClassifier(weka.core.Instances data) throws ExceptionBuilds the base classifier using the provided data.- Specified by:
buildClassifierin interfaceweka.classifiers.Classifier- Parameters:
data- the data to use- Throws:
Exception- if build fails or data not supported
-
classifyInstance
public double classifyInstance(weka.core.Instance instance) throws ExceptionClassifies the given instance.- Specified by:
classifyInstancein interfaceweka.classifiers.Classifier- Overrides:
classifyInstancein classweka.classifiers.AbstractClassifier- Parameters:
instance- the instance to classify- Returns:
- the classification (label index) or regression value
- Throws:
Exception- if classification fails
-
distributionForInstance
public double[] distributionForInstance(weka.core.Instance instance) throws ExceptionReturns the class distribution for the given instance.- Specified by:
distributionForInstancein interfaceweka.classifiers.Classifier- Overrides:
distributionForInstancein classweka.classifiers.AbstractClassifier- Parameters:
instance- the instance to obtain the class distribution for- Returns:
- the class distribution
- Throws:
Exception- if classification fails
-
-