Class RemoveMisclassifiedCleaner

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SerializableObject, adams.core.ShallowCopySupporter<AbstractCleaner>, adams.core.SizeOfHandler, adams.flow.core.FlowContextHandler, Serializable, Comparable

    public class RemoveMisclassifiedCleaner
    extends AbstractSerializableCleaner
    Removes instances that are misclassified by the given relative difference, unless they are within the absolute difference.

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to
        the console (0 = off).
        default: 0
        minimum: 0
     
    -serialization-file <adams.core.io.PlaceholderFile> (property: serializationFile)
        The file to serialize the generated internal model to.
        default: ${CWD}
     
    -override-serialized-file (property: overrideSerializedFile)
        If set to true, then any serialized file will be ignored and the setup for
        serialization will be regenerated.
     
    -reldiff <double> (property: reldiff)
        Maximum relative difference between target and prediction; predictions beyond
        this difference will be removed; to turn off, use 0.
        default: 0.25
     
    -absdiff <double> (property: absdiff)
        If the diffence between target and prediction is <= this value, then the
        instance will not be removed regardless of relative difference.
        default: 1.0
     
    -iterations <int> (property: iterations)
        Number of passes for the misclassification process.
        default: 1
     
    -folds <int> (property: folds)
        Number of folds for the cross-validation.
        default: 3
     
    -classifier <weka.classifiers.Classifier> (property: classifier)
        Classifier to use for generating predictions.
        default: weka.classifiers.meta.SpectrumClassifier -W weka.classifiers.functions.PLSClassifier -- -filter \"weka.filters.supervised.attribute.PLSFilter -C 20 -M -A PLS1 -P center\"
     
    Author:
    dale (dale at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_RelDiff

        protected double m_RelDiff
        the relative difference.
      • m_AbsDiff

        protected double m_AbsDiff
        absolute difference.
      • m_Folds

        protected int m_Folds
        number of fold for the cross validation.
      • m_Iterations

        protected int m_Iterations
        number of cleaning iterations to run.
      • m_Classifier

        protected weka.classifiers.Classifier m_Classifier
        WEKA classifier used for modeling.
      • m_Filter

        protected weka.filters.unsupervised.instance.RemoveMisclassifiedRel m_Filter
        the filter.
      • m_FilteredInitData

        protected weka.core.Instances m_FilteredInitData
        the filtered data generated when initializing the postprocessor.
    • Constructor Detail

      • RemoveMisclassifiedCleaner

        public RemoveMisclassifiedCleaner()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractSerializableCleaner
      • setReldiff

        public void setReldiff​(double value)
        Sets the relative difference.
        Parameters:
        value - relative difference
      • getReldiff

        public double getReldiff()
        Returns the relative difference.
        Returns:
        the relative difference
      • reldiffTipText

        public String reldiffTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAbsdiff

        public void setAbsdiff​(double value)
        Sets the absolute difference.
        Parameters:
        value - absolute difference
      • getAbsdiff

        public double getAbsdiff()
        Returns the absolute difference.
        Returns:
        the absolute difference
      • absdiffTipText

        public String absdiffTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setIterations

        public void setIterations​(int value)
        Sets the iterations.
        Parameters:
        value - iterations
      • getIterations

        public int getIterations()
        Returns the iterations.
        Returns:
        the iterations
      • iterationsTipText

        public String iterationsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setFolds

        public void setFolds​(int value)
        Sets the folds.
        Parameters:
        value - folds
      • getFolds

        public int getFolds()
        Returns the folds.
        Returns:
        the folds
      • foldsTipText

        public String foldsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setClassifier

        public void setClassifier​(weka.classifiers.Classifier value)
        Sets the classifier.
        Parameters:
        value - classifier
      • getClassifier

        public weka.classifiers.Classifier getClassifier()
        Returns the classifier.
        Returns:
        the classifier
      • classifierTipText

        public String classifierTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • performCheck

        protected String performCheck​(weka.core.Instance data)
        Performs the actual check.
        Specified by:
        performCheck in class AbstractCleaner
        Parameters:
        data - the Instance to check
        Returns:
        null if ok, otherwise error message
      • initSerializationSetup

        public void initSerializationSetup()
        Regenerates all the objects that are necessary for serialization.
      • retrieveSerializationSetup

        public Object[] retrieveSerializationSetup()
        Returns the member variables to serialize to a file.
        Returns:
        the objects to serialize
      • setSerializationSetup

        public void setSerializationSetup​(Object[] value)
        Updates the member variables with the provided objects obtained from deserialization.
        Parameters:
        value - the deserialized objects
      • performClean

        protected weka.core.Instances performClean​(weka.core.Instances instances)
        Clean Instances.
        Specified by:
        performClean in class AbstractCleaner
        Parameters:
        instances - Instances
        Returns:
        null if ok, otherwise error message