Class ReplaceMissingValuesWithZero

  • All Implemented Interfaces:
    Serializable, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.OptionHandler, weka.core.RevisionHandler, weka.filters.StreamableFilter, weka.filters.UnsupervisedFilter

    public class ReplaceMissingValuesWithZero
    extends weka.filters.Filter
    implements weka.filters.UnsupervisedFilter, weka.filters.StreamableFilter
    Replaces all missing values for nominal and numeric attributes in a dataset with the modes and means from the training data.

    Version:
    $Revision$
    Author:
    Eibe Frank (eibe@cs.waikato.ac.nz)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class weka.filters.Filter

        m_Debug, m_DoNotCheckCapabilities, m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      weka.core.Capabilities getCapabilities()
      Returns the Capabilities of this filter.
      String getRevision()
      Returns the revision string.
      String globalInfo()
      Returns a string describing this filter
      boolean input​(weka.core.Instance instance)
      Input an instance for filtering.
      static void main​(String[] argv)
      Main method for testing this class.
      boolean setInputFormat​(weka.core.Instances instanceInfo)
      Sets the format of the input instances.
      • Methods inherited from class weka.filters.Filter

        batchFilterFile, batchFinished, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getInputFormat, getOptions, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, listOptions, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOptions, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
    • Constructor Detail

      • ReplaceMissingValuesWithZero

        public ReplaceMissingValuesWithZero()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing this filter
        Returns:
        a description of the filter suitable for displaying in the explorer/experimenter gui
      • getCapabilities

        public weka.core.Capabilities getCapabilities()
        Returns the Capabilities of this filter.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Overrides:
        getCapabilities in class weka.filters.Filter
        Returns:
        the capabilities of this object
        See Also:
        Capabilities
      • setInputFormat

        public boolean setInputFormat​(weka.core.Instances instanceInfo)
                               throws Exception
        Sets the format of the input instances.
        Overrides:
        setInputFormat in class weka.filters.Filter
        Parameters:
        instanceInfo - an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).
        Returns:
        true if the outputFormat may be collected immediately
        Throws:
        Exception - if the input format can't be set successfully
      • input

        public boolean input​(weka.core.Instance instance)
        Input an instance for filtering. Filter requires all training instances be read before producing output.
        Overrides:
        input in class weka.filters.Filter
        Parameters:
        instance - the input instance
        Returns:
        true if the filtered instance may now be collected with output().
        Throws:
        IllegalStateException - if no input format has been set.
      • getRevision

        public String getRevision()
        Returns the revision string.
        Specified by:
        getRevision in interface weka.core.RevisionHandler
        Overrides:
        getRevision in class weka.filters.Filter
        Returns:
        the revision
      • main

        public static void main​(String[] argv)
        Main method for testing this class.
        Parameters:
        argv - should contain arguments to the filter: use -h for help