程序包 weka.clusterers

类 MakeDensityBasedClusterer

所有已实现的接口:
Serializable, Cloneable, Clusterer, DensityBasedClusterer, NumberOfClustersRequestable, CapabilitiesHandler, OptionHandler, RevisionHandler, WeightedInstancesHandler

public class MakeDensityBasedClusterer extends AbstractDensityBasedClusterer implements NumberOfClustersRequestable, OptionHandler, WeightedInstancesHandler
Class for wrapping a Clusterer to make it return a distribution and density. Fits normal distributions and discrete distributions within each cluster produced by the wrapped clusterer. Supports the NumberOfClustersRequestable interface only if the wrapped Clusterer does.

Valid options are:

 -M <num>
  minimum allowable standard deviation for normal density computation 
  (default 1e-6)
 -W <clusterer name>
  Clusterer to wrap.
  (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)
Options after "--" are passed on to the base clusterer.
版本:
$Revision: 5538 $
作者:
Richard Kirkby (rkirkby@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz), Eibe Frank (eibe@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • MakeDensityBasedClusterer

      public MakeDensityBasedClusterer()
      Default constructor.
    • MakeDensityBasedClusterer

      public MakeDensityBasedClusterer(Clusterer toWrap)
      Contructs a MakeDensityBasedClusterer wrapping a given Clusterer.
      参数:
      toWrap - the clusterer to wrap around
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing classifier
      返回:
      a description suitable for displaying in the explorer/experimenter gui
    • setNumClusters

      public void setNumClusters(int n) throws Exception
      Set the number of clusters to generate.
      指定者:
      setNumClusters 在接口中 NumberOfClustersRequestable
      参数:
      n - the number of clusters to generate
      抛出:
      Exception - if the wrapped clusterer has not been set, or if the wrapped clusterer does not implement this facility.
    • getCapabilities

      public Capabilities getCapabilities()
      Returns default capabilities of the clusterer (i.e., of the wrapper clusterer).
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      指定者:
      getCapabilities 在接口中 Clusterer
      覆盖:
      getCapabilities 在类中 AbstractClusterer
      返回:
      the capabilities of this clusterer
      另请参阅:
    • buildClusterer

      public void buildClusterer(Instances data) throws Exception
      Builds a clusterer for a set of instances.
      指定者:
      buildClusterer 在接口中 Clusterer
      指定者:
      buildClusterer 在类中 AbstractClusterer
      参数:
      data - the instances to train the clusterer with
      抛出:
      Exception - if the clusterer hasn't been set or something goes wrong
    • clusterPriors

      public double[] clusterPriors()
      Returns the cluster priors.
      指定者:
      clusterPriors 在接口中 DensityBasedClusterer
      指定者:
      clusterPriors 在类中 AbstractDensityBasedClusterer
      返回:
      the cluster priors
    • logDensityPerClusterForInstance

      public double[] logDensityPerClusterForInstance(Instance inst) throws Exception
      Computes the log of the conditional density (per cluster) for a given instance.
      指定者:
      logDensityPerClusterForInstance 在接口中 DensityBasedClusterer
      指定者:
      logDensityPerClusterForInstance 在类中 AbstractDensityBasedClusterer
      参数:
      inst - the instance to compute the density for
      返回:
      an array containing the estimated densities
      抛出:
      Exception - if the density could not be computed successfully
    • numberOfClusters

      public int numberOfClusters() throws Exception
      Returns the number of clusters.
      指定者:
      numberOfClusters 在接口中 Clusterer
      指定者:
      numberOfClusters 在类中 AbstractClusterer
      返回:
      the number of clusters generated for a training dataset.
      抛出:
      Exception - if number of clusters could not be returned successfully
    • toString

      public String toString()
      Returns a description of the clusterer.
      覆盖:
      toString 在类中 Object
      返回:
      a string containing a description of the clusterer
    • clustererTipText

      public String clustererTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setClusterer

      public void setClusterer(Clusterer toWrap)
      Sets the clusterer to wrap.
      参数:
      toWrap - the clusterer
    • getClusterer

      public Clusterer getClusterer()
      Gets the clusterer being wrapped.
      返回:
      the clusterer
    • minStdDevTipText

      public String minStdDevTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setMinStdDev

      public void setMinStdDev(double m)
      Set the minimum value for standard deviation when calculating normal density. Reducing this value can help prevent arithmetic overflow resulting from multiplying large densities (arising from small standard deviations) when there are many singleton or near singleton values.
      参数:
      m - minimum value for standard deviation
    • getMinStdDev

      public double getMinStdDev()
      Get the minimum allowable standard deviation.
      返回:
      the minumum allowable standard deviation
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options..
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      an enumeration of all the available options.
    • setOptions

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

      Valid options are:

       -M <num>
        minimum allowable standard deviation for normal density computation 
        (default 1e-6)
       -W <clusterer name>
        Clusterer to wrap.
        (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)
      指定者:
      setOptions 在接口中 OptionHandler
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the clusterer.
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      an array of strings suitable for passing to setOptions()
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 AbstractClusterer
      返回:
      the revision
    • main

      public static void main(String[] argv)
      Main method for testing this class.
      参数:
      argv - the options