Package weka.classifiers.meta
Class RangeCheck
- java.lang.Object
-
- weka.classifiers.AbstractClassifier
-
- weka.classifiers.SingleClassifierEnhancer
-
- weka.classifiers.meta.RangeCheck
-
- All Implemented Interfaces:
Serializable
,Cloneable
,weka.classifiers.Classifier
,RangeCheckClassifier
,weka.core.BatchPredictor
,weka.core.CapabilitiesHandler
,weka.core.CapabilitiesIgnorer
,weka.core.CommandlineRunnable
,weka.core.OptionHandler
,weka.core.RevisionHandler
public class RangeCheck extends weka.classifiers.SingleClassifierEnhancer implements RangeCheckClassifier
Keeps track of the ranges in case of numeric attributes. It then allows checks whether an instance is for one or more attributes outside the training range.
Valid options are:
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RangeCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildClassifier(weka.core.Instances data)
Build the classifier on the filtered data.List<String>
checkRangeForInstance(weka.core.Instance inst)
Checks the range for the instance.double[]
distributionForInstance(weka.core.Instance instance)
Classifies a given instance after filtering.String
globalInfo()
Returns a string describing this classifier.String
toString()
Output a representation of this classifier-
Methods inherited from class weka.classifiers.SingleClassifierEnhancer
classifierTipText, defaultClassifierOptions, defaultClassifierString, getCapabilities, getClassifier, getClassifierSpec, getOptions, listOptions, postExecution, preExecution, setClassifier, setOptions
-
Methods inherited from class weka.classifiers.AbstractClassifier
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, getRevision, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing this classifier.- Returns:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
buildClassifier
public void buildClassifier(weka.core.Instances data) throws Exception
Build the classifier on the filtered data.- Specified by:
buildClassifier
in interfaceweka.classifiers.Classifier
- Parameters:
data
- the training data- Throws:
Exception
- if the classifier could not be built successfully
-
distributionForInstance
public double[] distributionForInstance(weka.core.Instance instance) throws Exception
Classifies a given instance after filtering.- Specified by:
distributionForInstance
in interfaceweka.classifiers.Classifier
- Overrides:
distributionForInstance
in classweka.classifiers.AbstractClassifier
- Parameters:
instance
- the instance to be classified- Returns:
- the class distribution for the given instance
- Throws:
Exception
- if instance could not be classified successfully
-
checkRangeForInstance
public List<String> checkRangeForInstance(weka.core.Instance inst)
Checks the range for the instance. The array contains an entry for each attribute that exceeded the stored ranges.- Specified by:
checkRangeForInstance
in interfaceRangeCheckClassifier
- Parameters:
inst
- the instance to check- Returns:
- the failed checks
-
-