|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.meta.MultiClassClassifier
Class for handling multi-class datasets with 2-class distribution classifiers.
Valid options are:
-M num
Sets the method to use. Valid values are 0 (1-against-all),
1 (random codes), 2 (exhaustive code), and 3 (1-against-1). (default 0)
-R num
Sets the multiplier when using random codes. (default 2.0)
-W classname
Specify the full class name of a classifier as the basis for
the multi-class classifier (required).
-Q seed
Random number seed (default 1).
Field Summary | |
static int |
METHOD_1_AGAINST_1
|
static int |
METHOD_1_AGAINST_ALL
The error correction modes |
static int |
METHOD_ERROR_EXHAUSTIVE
|
static int |
METHOD_ERROR_RANDOM
|
static Tag[] |
TAGS_METHOD
|
Constructor Summary | |
MultiClassClassifier()
|
Method Summary | |
void |
buildClassifier(Instances insts)
Builds the classifiers. |
java.lang.String |
classifierTipText()
|
double[] |
distributionForInstance(Instance inst)
Returns the distribution for an instance. |
Classifier |
getClassifier()
Get the classifier used as the classifier |
SelectedTag |
getMethod()
Gets the method used. |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
double |
getRandomWidthFactor()
Gets the multiplier when generating random codes. |
int |
getSeed()
Gets the random number seed. |
java.lang.String |
globalInfo()
|
double[] |
individualPredictions(Instance inst)
Returns the individual predictions of the base classifiers for an instance. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
methodTipText()
|
java.lang.String |
randomWidthFactorTipText()
|
void |
setClassifier(Classifier newClassifier)
Set the base classifier. |
void |
setMethod(SelectedTag newMethod)
Sets the method used. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setRandomWidthFactor(double newRandomWidthFactor)
Sets the multiplier when generating random codes. |
void |
setSeed(int seed)
Sets the seed for random number generation. |
java.lang.String |
toString()
Prints the classifiers. |
Methods inherited from class weka.classifiers.Classifier |
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int METHOD_1_AGAINST_ALL
public static final int METHOD_ERROR_RANDOM
public static final int METHOD_ERROR_EXHAUSTIVE
public static final int METHOD_1_AGAINST_1
public static final Tag[] TAGS_METHOD
Constructor Detail |
public MultiClassClassifier()
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[] individualPredictions(Instance inst) throws java.lang.Exception
java.lang.Exception
- if the predictions can't be computed successfullypublic double[] distributionForInstance(Instance inst) throws java.lang.Exception
distributionForInstance
in class Classifier
inst
- the instance to be classified
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
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-M num
Sets the method to use. Valid values are 0 (1-against-all),
1 (random codes), 2 (exhaustive code), and 3 (1-against-1). (default 0)
-R num
Sets the multiplier when using random codes. (default 2.0)
-W classname
Specify the full class name of a learner as the basis for
the multiclassclassifier (required).
-Q seed
Random number seed (default 1).
setOptions
in interface OptionHandler
setOptions
in class Classifier
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Classifier
public java.lang.String globalInfo()
public java.lang.String randomWidthFactorTipText()
public double getRandomWidthFactor()
public void setRandomWidthFactor(double newRandomWidthFactor)
newRandomWidthFactor
- the new width multiplierpublic java.lang.String methodTipText()
public SelectedTag getMethod()
public void setMethod(SelectedTag newMethod)
newMethod
- the new method.public java.lang.String classifierTipText()
public void setClassifier(Classifier newClassifier)
newClassifier
- the Classifier to use.public Classifier getClassifier()
public void setSeed(int seed)
seed
- the random number seedpublic int getSeed()
public static void main(java.lang.String[] argv)
argv
- the options
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London