All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.clusterers.DistributionMetaClusterer

java.lang.Object
   |
   +----weka.clusterers.Clusterer
           |
           +----weka.clusterers.DistributionClusterer
                   |
                   +----weka.clusterers.DistributionMetaClusterer

public class DistributionMetaClusterer
extends DistributionClusterer
implements OptionHandler
Class that wraps up a Clusterer and presents it as a DistributionClusterer for ease of programmatically handling Clusterers in general -- only the one predict method (distributionForInstance) need be worried about. The distributions produced by this clusterer place a probability of 1 on the class value predicted by the sub-clusterer.

Valid options are:

-W classname
Specify the full class name of a sub-clusterer (required).

Author:
Richard Littin (richard@intelligenesis.net)

Constructor Index

 o DistributionMetaClusterer()

Method Index

 o buildClusterer(Instances)
Builds the clusterer.
 o densityForInstance(Instance)
Returns the density for an instance.
 o distributionForInstance(Instance)
Returns the distribution for an instance.
 o getClusterer()
Get the clusterer used as the clusterer
 o getOptions()
Gets the current settings of the Clusterer.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o numberOfClusters()
Returns the number of clusters.
 o setClusterer(Clusterer)
Set the base clusterer.
 o setOptions(String[])
Parses a given list of options.
 o toString()
Prints the clusterers.

Constructors

 o DistributionMetaClusterer
 public DistributionMetaClusterer()

Methods

 o buildClusterer
 public void buildClusterer(Instances insts) throws Exception
Builds the clusterer.

Parameters:
insts - the training data.
Throws: Exception
if a clusterer can't be built
Overrides:
buildClusterer in class Clusterer
 o distributionForInstance
 public double[] distributionForInstance(Instance inst) throws Exception
Returns the distribution for an instance.

Throws: Exception
if the distribution can't be computed successfully
Overrides:
distributionForInstance in class DistributionClusterer
 o densityForInstance
 public double densityForInstance(Instance inst) throws Exception
Returns the density for an instance.

Throws: Exception
if the distribution can't be computed successfully
Overrides:
densityForInstance in class DistributionClusterer
 o numberOfClusters
 public int numberOfClusters() throws Exception
Returns the number of clusters.

Returns:
the number of clusters generated for a training dataset.
Throws: Exception
if number of clusters could not be returned successfully
Overrides:
numberOfClusters in class Clusterer
 o toString
 public String toString()
Prints the clusterers.

Overrides:
toString in class Object
 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options

Returns:
an enumeration of all the available options
 o setOptions
 public void setOptions(String options[]) throws Exception
Parses a given list of options. Valid options are:

-W classname
Specify the full class name of a learner as the basis for the multiclassclusterer (required).

Parameters:
options - the list of options as an array of strings
Throws: Exception
if an option is not supported
 o getOptions
 public String[] getOptions()
Gets the current settings of the Clusterer.

Returns:
an array of strings suitable for passing to setOptions
 o setClusterer
 public void setClusterer(Clusterer newClusterer)
Set the base clusterer.

Parameters:
newClusterer - the Clusterer to use.
 o getClusterer
 public Clusterer getClusterer()
Get the clusterer used as the clusterer

Returns:
the clusterer used as the clusterer
 o main
 public static void main(String argv[])
Main method for testing this class.

Parameters:
argv - the options

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home