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)

Variable Index

 o ERROR_EXHAUSTIVE
 o ERROR_NONE
The error correction modes
 o ERROR_RANDOM
 o TAGS_ERROR

Constructor Index

 o MultiClassClassifier()

Method Index

 o buildClassifier(Instances)
Builds the classifiers.
 o distributionClassifierTipText()
 o distributionForInstance(Instance)
Returns the distribution for an instance.
 o errorCorrectionModeTipText()
 o getDistributionClassifier()
Get the classifier used as the classifier
 o getErrorCorrectionMode()
Gets the error correction mode used.
 o getOptions()
Gets the current settings of the Classifier.
 o getRandomWidthFactor()
Gets the multiplier when generating random codes.
 o globalInfo()
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o randomWidthFactorTipText()
 o setDistributionClassifier(DistributionClassifier)
Set the base classifier.
 o setErrorCorrectionMode(SelectedTag)
Sets the error correction mode used.
 o setOptions(String[])
Parses a given list of options.
 o setRandomWidthFactor(double)
Sets the multiplier when generating random codes.
 o toString()
Prints the classifiers.

Variables

 o ERROR_NONE
 public static final int ERROR_NONE
The error correction modes

 o ERROR_RANDOM
 public static final int ERROR_RANDOM
 o ERROR_EXHAUSTIVE
 public static final int ERROR_EXHAUSTIVE
 o TAGS_ERROR
 public static final Tag TAGS_ERROR[]

Constructors

 o MultiClassClassifier
 public MultiClassClassifier()

Methods

 o 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
 o 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
 o toString
 public String toString()
Prints the classifiers.

Overrides:
toString in class Object
 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options

Returns:
an enumeration of all the available options
 o 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
 o getOptions
 public String[] getOptions()
Gets the current settings of the Classifier.

Returns:
an array of strings suitable for passing to setOptions
 o globalInfo
 public String globalInfo()
Returns:
a description of the classifier suitable for displaying in the explorer/experimenter gui
 o randomWidthFactorTipText
 public String randomWidthFactorTipText()
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getRandomWidthFactor
 public double getRandomWidthFactor()
Gets the multiplier when generating random codes. Will generate numClasses * m_RandomWidthFactor codes.

Returns:
the width multiplier
 o 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
 o errorCorrectionModeTipText
 public String errorCorrectionModeTipText()
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o 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.
 o 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.
 o distributionClassifierTipText
 public String distributionClassifierTipText()
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setDistributionClassifier
 public void setDistributionClassifier(DistributionClassifier newClassifier)
Set the base classifier.

Parameters:
newClassifier - the Classifier to use.
 o getDistributionClassifier
 public DistributionClassifier getDistributionClassifier()
Get the classifier used as the classifier

Returns:
the classifier used as the classifier
 o 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