Class DistanceToCenter

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

    public class DistanceToCenter
    extends AbstractNearestNeighborBasedEvaluator
    Uses the specified nearest neighbor search to determine a neighborhood. From this neighborhood the center is calculated (only using numeric attributes) and the distance to the center is returned.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -missing-evaluation <float> (property: missingEvaluation)
        The value to use as replacement for missing evaluations.
        default: NaN
     
    -serialization-file <adams.core.io.PlaceholderFile> (property: serializationFile)
        The file to serialize the generated internal model to.
        default: ${CWD}
     
    -override-serialized-file <boolean> (property: overrideSerializedFile)
        If set to true, then any serialized file will be ignored and the setup for 
        serialization will be regenerated.
        default: false
     
    -search <weka.core.neighboursearch.NearestNeighbourSearch> (property: search)
        The nearest neighbor search to use.
        default: weka.core.neighboursearch.LinearNNSearch -A \"weka.core.EuclideanDistance -R first-last\"
     
    -filter <weka.filters.Filter> (property: filter)
        The filter to apply to the data.
        default: weka.filters.AllFilter
     
    -num-neighbors <int> (property: numNeighbors)
        The number of neighbors to use in the neighborhood.
        default: 100
        minimum: 1
     
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Filter

        protected weka.filters.Filter m_Filter
        the filter to use for filtering.
      • m_ActualFilter

        protected weka.filters.Filter m_ActualFilter
        the actual filter.
      • m_NumNeighbors

        protected int m_NumNeighbors
        the number of neighbors to use.
      • m_RawTrainingData

        protected transient weka.core.Instances m_RawTrainingData
        the raw training data.
    • Constructor Detail

      • DistanceToCenter

        public DistanceToCenter()
    • 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
      • setFilter

        public void setFilter​(weka.filters.Filter value)
        Sets the filter to use.
        Parameters:
        value - the filter
      • getFilter

        public weka.filters.Filter getFilter()
        Returns the filter to use.
        Returns:
        the filter
      • filterTipText

        public String filterTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setNumNeighbors

        public void setNumNeighbors​(int value)
        Sets the number of neighbors to use in the neighborhood.
        Parameters:
        value - the number of neighbors
      • getNumNeighbors

        public int getNumNeighbors()
        Returns the number of neighbors to use in the neighborhood.
        Returns:
        the number of neighbors
      • numNeighborsTipText

        public String numNeighborsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • performBuild

        protected boolean performBuild​(weka.core.Instances data)
        Builds the evaluator.
        Specified by:
        performBuild in class AbstractEvaluator
        Parameters:
        data - the instance to check
        Returns:
        true if build successful
      • 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