All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.classifiers.MultiClassClassifier
java.lang.Object
|
+----weka.classifiers.Classifier
|
+----weka.classifiers.DistributionClassifier
|
+----weka.classifiers.MultiClassClassifier
- public class MultiClassClassifier
- extends DistributionClassifier
- implements OptionHandler
Class for handling multi-class datasets with 2-class distribution
classifiers.
Valid options are:
-E num
Sets the error-correction mode. Valid values are 0 (no correction),
1 (random codes), and 2 (exhaustive code). (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).
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (len@webmind.com)
-
ERROR_EXHAUSTIVE
-
-
ERROR_NONE
- The error correction modes
-
ERROR_RANDOM
-
-
TAGS_ERROR
-
-
MultiClassClassifier()
-
-
buildClassifier(Instances)
- Builds the classifiers.
-
distributionClassifierTipText()
-
-
distributionForInstance(Instance)
- Returns the distribution for an instance.
-
errorCorrectionModeTipText()
-
-
getDistributionClassifier()
- Get the classifier used as the classifier
-
getErrorCorrectionMode()
- Gets the error correction mode used.
-
getOptions()
- Gets the current settings of the Classifier.
-
getRandomWidthFactor()
- Gets the multiplier when generating random codes.
-
globalInfo()
-
-
listOptions()
- Returns an enumeration describing the available options
-
main(String[])
- Main method for testing this class.
-
randomWidthFactorTipText()
-
-
setDistributionClassifier(DistributionClassifier)
- Set the base classifier.
-
setErrorCorrectionMode(SelectedTag)
- Sets the error correction mode used.
-
setOptions(String[])
- Parses a given list of options.
-
setRandomWidthFactor(double)
- Sets the multiplier when generating random codes.
-
toString()
- Prints the classifiers.
ERROR_NONE
public static final int ERROR_NONE
- The error correction modes
ERROR_RANDOM
public static final int ERROR_RANDOM
ERROR_EXHAUSTIVE
public static final int ERROR_EXHAUSTIVE
TAGS_ERROR
public static final Tag TAGS_ERROR[]
MultiClassClassifier
public MultiClassClassifier()
buildClassifier
public void buildClassifier(Instances insts) throws Exception
- Builds the classifiers.
- Parameters:
- insts - the training data.
- Throws: Exception
- if a classifier can't be built
- Overrides:
- buildClassifier in class Classifier
distributionForInstance
public double[] distributionForInstance(Instance inst) throws Exception
- Returns the distribution for an instance.
- Throws: Exception
- if the distribution can't be computed successfully
- Overrides:
- distributionForInstance in class DistributionClassifier
toString
public String toString()
- Prints the classifiers.
- Overrides:
- toString in class Object
listOptions
public Enumeration listOptions()
- Returns an enumeration describing the available options
- Returns:
- an enumeration of all the available options
setOptions
public void setOptions(String options[]) throws Exception
- Parses a given list of options. Valid options are:
-E num
Sets the error-correction mode. Valid values are 0 (no correction),
1 (random codes), and 2 (exhaustive code). (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).
- Parameters:
- options - the list of options as an array of strings
- Throws: Exception
- if an option is not supported
getOptions
public String[] getOptions()
- Gets the current settings of the Classifier.
- Returns:
- an array of strings suitable for passing to setOptions
globalInfo
public String globalInfo()
- Returns:
- a description of the classifier suitable for
displaying in the explorer/experimenter gui
randomWidthFactorTipText
public String randomWidthFactorTipText()
- Returns:
- tip text for this property suitable for
displaying in the explorer/experimenter gui
getRandomWidthFactor
public double getRandomWidthFactor()
- Gets the multiplier when generating random codes. Will generate
numClasses * m_RandomWidthFactor codes.
- Returns:
- the width multiplier
setRandomWidthFactor
public void setRandomWidthFactor(double newRandomWidthFactor)
- Sets the multiplier when generating random codes. Will generate
numClasses * m_RandomWidthFactor codes.
- Parameters:
- newRandomWidthFactor - the new width multiplier
errorCorrectionModeTipText
public String errorCorrectionModeTipText()
- Returns:
- tip text for this property suitable for
displaying in the explorer/experimenter gui
getErrorCorrectionMode
public SelectedTag getErrorCorrectionMode()
- Gets the error correction mode used. Will be one of
ERROR_NONE, ERROR_RANDOM, or ERROR_EXHAUSTIVE.
- Returns:
- the current error correction mode.
setErrorCorrectionMode
public void setErrorCorrectionMode(SelectedTag newMethod)
- Sets the error correction mode used. Will be one of
ERROR_NONE, ERROR_RANDOM, or ERROR_EXHAUSTIVE.
- Parameters:
- newMethod - the new error correction mode.
distributionClassifierTipText
public String distributionClassifierTipText()
- Returns:
- tip text for this property suitable for
displaying in the explorer/experimenter gui
setDistributionClassifier
public void setDistributionClassifier(DistributionClassifier newClassifier)
- Set the base classifier.
- Parameters:
- newClassifier - the Classifier to use.
getDistributionClassifier
public DistributionClassifier getDistributionClassifier()
- Get the classifier used as the classifier
- Returns:
- the classifier used as the classifier
main
public static void main(String argv[])
- Main method for testing this class.
- Parameters:
- argv - the options
All Packages Class Hierarchy This Package Previous Next Index WEKA's home