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)
DistributionMetaClusterer()
-
buildClusterer(Instances)
- Builds the clusterer.
densityForInstance(Instance)
- Returns the density for an instance.
distributionForInstance(Instance)
- Returns the distribution for an instance.
getClusterer()
- Get the clusterer used as the clusterer
getOptions()
- Gets the current settings of the Clusterer.
listOptions()
- Returns an enumeration describing the available options
main(String[])
- Main method for testing this class.
numberOfClusters()
- Returns the number of clusters.
setClusterer(Clusterer)
- Set the base clusterer.
setOptions(String[])
- Parses a given list of options.
toString()
- Prints the clusterers.
DistributionMetaClusterer
public DistributionMetaClusterer()
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
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
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
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
toString
public java.lang.String toString()
Prints the clusterers.
- Overrides:
- toString in class java.lang.Object
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options
- Returns:
- an enumeration of all the available options
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
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the Clusterer.
- Returns:
- an array of strings suitable for passing to setOptions
setClusterer
public void setClusterer(Clusterer newClusterer)
Set the base clusterer.
- Parameters:
newClusterer
- the Clusterer to use.
getClusterer
public Clusterer getClusterer()
Get the clusterer used as the clusterer
- Returns:
- the clusterer used as the clusterer
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