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

Class weka.classifiers.DistributionMetaClassifier

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.DistributionClassifier
                    |
                    +----weka.classifiers.DistributionMetaClassifier

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

Valid options are:

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

Version:
$Revision: 1.5 $
Author:
Len Trigg (len@intelligenesis.net)

Constructor Index

 o DistributionMetaClassifier()
Default constructor
 o DistributionMetaClassifier(Classifier)
Creates a new DistributionMetaClassifier instance, specifying the Classifier to wrap around.

Method Index

 o buildClassifier(Instances)
Builds the classifier.
 o distributionForInstance(Instance)
Returns the distribution for an instance.
 o getClassifier()
Get the classifier used as the classifier
 o getOptions()
Gets the current settings of the Classifier.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o setClassifier(Classifier)
Set the base classifier.
 o setOptions(String[])
Parses a given list of options.
 o toString()
Prints the classifiers.

Constructor Detail

 o DistributionMetaClassifier
public DistributionMetaClassifier()
          Default constructor
 o DistributionMetaClassifier
public DistributionMetaClassifier(Classifier subClassifier)
          Creates a new DistributionMetaClassifier instance, specifying the Classifier to wrap around.
Parameters:
subClassifier - a Classifier.

Method Detail

 o buildClassifier
public void buildClassifier(Instances insts) throws java.lang.Exception
          Builds the classifier.
Parameters:
insts - the training data.
Throws:
java.lang.Exception - if a classifier can't be built
Overrides:
buildClassifier in class Classifier
 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 DistributionClassifier
 o toString
public java.lang.String toString()
          Prints the classifiers.
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 multiclassclassifier (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 Classifier.
Returns:
an array of strings suitable for passing to setOptions
 o setClassifier
public void setClassifier(Classifier newClassifier)
          Set the base classifier.
Parameters:
newClassifier - the Classifier to use.
 o getClassifier
public Classifier getClassifier()
          Get the classifier used as the classifier
Returns:
the classifier used as the classifier
 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