|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.DistributionClassifier | +--weka.classifiers.DistributionMetaClassifier
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).
Constructor Summary | |
DistributionMetaClassifier()
Default constructor |
|
DistributionMetaClassifier(Classifier subClassifier)
Creates a new DistributionMetaClassifier instance,
specifying the Classifier to wrap around. |
Method Summary | |
void |
buildClassifier(Instances insts)
Builds the classifier. |
double[] |
distributionForInstance(Instance inst)
Returns the distribution for an instance. |
Classifier |
getClassifier()
Get the classifier used as the classifier |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
void |
setClassifier(Classifier newClassifier)
Set the base classifier. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
java.lang.String |
toString()
Prints the classifiers. |
Methods inherited from class weka.classifiers.DistributionClassifier |
classifyInstance |
Methods inherited from class weka.classifiers.Classifier |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DistributionMetaClassifier()
public DistributionMetaClassifier(Classifier subClassifier)
DistributionMetaClassifier
instance,
specifying the Classifier to wrap around.subClassifier
- a Classifier
.Method Detail |
public void buildClassifier(Instances insts) throws java.lang.Exception
buildClassifier
in class Classifier
insts
- the training data.java.lang.Exception
- if a classifier can't be builtpublic double[] distributionForInstance(Instance inst) throws java.lang.Exception
distributionForInstance
in class DistributionClassifier
java.lang.Exception
- if the distribution can't be computed successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-W classname
Specify the full class name of a learner as the basis for
the multiclassclassifier (required).
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public void setClassifier(Classifier newClassifier)
newClassifier
- the Classifier to use.public Classifier getClassifier()
public static void main(java.lang.String[] argv)
argv
- the options
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |