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).

Version:
$Revision: 1.4 $
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.

Constructor Detail

 o DistributionMetaClusterer
public DistributionMetaClusterer()

Method Detail

 o buildClusterer
public void buildClusterer(Instances insts) throws java.lang.Exception
          Builds the clusterer.
Parameters:
insts - the training data.
Throws:
java.lang.Exception - if a clusterer can't be built
Overrides:
buildClusterer in class Clusterer
 o distributionForInstance
public double[] distributionForInstance(Instance inst) throws java.lang.Exception
          Returns the distribution for an instance.
Throws:
java.lang.Exception - if the distribution can't be computed successfully
Overrides:
distributionForInstance in class DistributionClusterer
 o densityForInstance
public double densityForInstance(Instance inst) throws java.lang.Exception
          Returns the density for an instance.
Throws:
java.lang.Exception - if the distribution can't be computed successfully
Overrides:
densityForInstance in class DistributionClusterer
 o numberOfClusters
public int numberOfClusters() throws java.lang.Exception
          Returns the number of clusters.
Returns:
the number of clusters generated for a training dataset.
Throws:
java.lang.Exception - if number of clusters could not be returned successfully
Overrides:
numberOfClusters in class Clusterer
 o toString
public java.lang.String toString()
          Prints the clusterers.
Overrides:
toString in class java.lang.Object
 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
Returns:
an enumeration of all the available options
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.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:
java.lang.Exception - if an option is not supported
 o getOptions
public java.lang.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(java.lang.String argv[])
          Main method for testing this class.
Parameters:
argv - the options

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