Class FilteredClusterer

  • All Implemented Interfaces:
    Serializable, Cloneable, Clusterer, CapabilitiesHandler, CapabilitiesIgnorer, CommandlineRunnable, Drawable, OptionHandler, RevisionHandler

    public class FilteredClusterer
    extends SingleClustererEnhancer
    implements Drawable
    Class for running an arbitrary clusterer on data that has been passed through an arbitrary filter. Like the clusterer, the structure of the filter is based exclusively on the training data and test instances will be processed by the filter without changing their structure.

    Valid options are:

     -F <filter specification>
      Full class name of filter to use, followed
      by filter options.
      eg: "weka.filters.unsupervised.attribute.Remove -V -R 1,2"
     (default: weka.filters.AllFilter)
     
     -W
      Full name of base clusterer.
      (default: weka.clusterers.SimpleKMeans)
     
     Options specific to clusterer weka.clusterers.SimpleKMeans:
     
     -N <num>
      number of clusters.
      (default 2).
     
     -V
      Display std. deviations for centroids.
     
     -M
      Replace missing values with mean/mode.
     
     -S <num>
      Random number seed.
      (default 10)
     
    Based on code from the FilteredClassifier by Len Trigg.
    Version:
    $Revision$
    Author:
    Len Trigg (trigg@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    FilteredClassifier, Serialized Form
    • Constructor Detail

      • FilteredClusterer

        public FilteredClusterer()
        Default constructor.
    • Method Detail

      • globalInfo

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

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options.

        Valid options are:

         -F <filter specification>
          Full class name of filter to use, followed
          by filter options.
          eg: "weka.filters.unsupervised.attribute.Remove -V -R 1,2"
         (default: weka.filters.AllFilter)
         
         -W
          Full name of base clusterer.
          (default: weka.clusterers.SimpleKMeans)
         
         Options specific to clusterer weka.clusterers.SimpleKMeans:
         
         -N <num>
          number of clusters.
          (default 2).
         
         -V
          Display std. deviations for centroids.
         
         -M
          Replace missing values with mean/mode.
         
         -S <num>
          Random number seed.
          (default 10)
         
        Specified by:
        setOptions in interface OptionHandler
        Overrides:
        setOptions in class SingleClustererEnhancer
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • 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
      • setFilter

        public void setFilter​(Filter filter)
        Sets the filter.
        Parameters:
        filter - the filter with all options set.
      • getFilter

        public Filter getFilter()
        Gets the filter used.
        Returns:
        the filter
      • toString

        public String toString()
        Output a representation of this clusterer.
        Overrides:
        toString in class Object
        Returns:
        a representation of this clusterer
      • graphType

        public int graphType()
        Returns the type of graph this clusterer represents.
        Specified by:
        graphType in interface Drawable
        Returns:
        the graph type of this clusterer
      • graph

        public String graph()
                     throws Exception
        Returns graph describing the clusterer (if possible).
        Specified by:
        graph in interface Drawable
        Returns:
        the graph of the clusterer in dotty format
        Throws:
        Exception - if the clusterer cannot be graphed
      • main

        public static void main​(String[] args)
        Main method for testing this class.
        Parameters:
        args - the commandline options, use "-h" for help