Class 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:

      If set, classifier is run in debug mode and
      may output additional info to the console
      Full name of base classifier.
      (default: weka.classifiers.rules.ZeroR)
     Options specific to classifier weka.classifiers.rules.ZeroR:
      If set, classifier is run in debug mode and
      may output additional info to the console
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Modifier and Type Field Description
      protected weka.core.Instances m_Header
      the training header.
      protected Hashtable<Integer,​double[]> m_Ranges
      the ranges (attribute index <-> double[]).
      • Fields inherited from class weka.classifiers.SingleClassifierEnhancer

      • Fields inherited from class weka.classifiers.AbstractClassifier

        BATCH_SIZE_DEFAULT, m_BatchSize, m_Debug, m_DoNotCheckCapabilities, m_numDecimalPlaces, NUM_DECIMAL_PLACES_DEFAULT
    • Constructor Summary

      Constructor Description
    • 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
      • Methods inherited from interface weka.classifiers.Classifier

        classifyInstance, getCapabilities
    • Field Detail

      • m_Ranges

        protected Hashtable<Integer,​double[]> m_Ranges
        the ranges (attribute index <-> double[]).
      • m_Header

        protected weka.core.Instances m_Header
        the training header.
    • Constructor Detail

      • RangeCheck

        public RangeCheck()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing this classifier.
        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 interface weka.classifiers.Classifier
        data - the training data
        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 interface weka.classifiers.Classifier
        distributionForInstance in class weka.classifiers.AbstractClassifier
        instance - the instance to be classified
        the class distribution for the given instance
        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 interface RangeCheckClassifier
        inst - the instance to check
        the failed checks
      • toString

        public String toString()
        Output a representation of this classifier
        toString in class Object
        a representation of this classifier