类 MultiClassClassifier
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.RandomizableSingleClassifierEnhancer
weka.classifiers.meta.MultiClassClassifier
- 所有已实现的接口:
Serializable
,Cloneable
,CapabilitiesHandler
,OptionHandler
,Randomizable
,RevisionHandler
public class MultiClassClassifier
extends RandomizableSingleClassifierEnhancer
implements OptionHandler
A metaclassifier for handling multi-class datasets with 2-class classifiers. This classifier is also capable of applying error correcting output codes for increased accuracy.
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)
-P Use pairwise coupling (only has an effect for 1-against1)
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.functions.Logistic)
Options specific to classifier weka.classifiers.functions.Logistic:
-D Turn on debugging output.
-R <ridge> Set the ridge in the log-likelihood.
-M <number> Set the maximum number of iterations (default -1, until convergence).
- 版本:
- $Revision: 1.48 $
- 作者:
- Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (len@reeltwo.com), Richard Kirkby (rkirkby@cs.waikato.ac.nz)
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明static final int
1-against-1static final int
1-against-allstatic final int
exhaustive correction codestatic final int
random correction codestatic final Tag[]
The error correction modes -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildClassifier
(Instances insts) Builds the classifiers.double[]
Returns the distribution for an instance.Returns default capabilities of the classifier.Gets the method used.String[]
Gets the current settings of the Classifier.double
Gets the multiplier when generating random codes.Returns the revision string.boolean
Gets whether to use pairwise coupling with 1-vs-1 classification to improve probability estimates.double[]
Returns the individual predictions of the base classifiers for an instance.Returns an enumeration describing the available optionsstatic void
Main method for testing this class.static double[]
pairwiseCoupling
(double[][] n, double[][] r) Implements pairwise coupling.void
setMethod
(SelectedTag newMethod) Sets the method used.void
setOptions
(String[] options) Parses a given list of options.void
setRandomWidthFactor
(double newRandomWidthFactor) Sets the multiplier when generating random codes.void
setUsePairwiseCoupling
(boolean p) Set whether to use pairwise coupling with 1-vs-1 classification to improve probability estimates.toString()
Prints the classifiers.从类继承的方法 weka.classifiers.RandomizableSingleClassifierEnhancer
getSeed, seedTipText, setSeed
从类继承的方法 weka.classifiers.SingleClassifierEnhancer
classifierTipText, getClassifier, setClassifier
从类继承的方法 weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
-
字段详细资料
-
METHOD_1_AGAINST_ALL
public static final int METHOD_1_AGAINST_ALL1-against-all- 另请参阅:
-
METHOD_ERROR_RANDOM
public static final int METHOD_ERROR_RANDOMrandom correction code- 另请参阅:
-
METHOD_ERROR_EXHAUSTIVE
public static final int METHOD_ERROR_EXHAUSTIVEexhaustive correction code- 另请参阅:
-
METHOD_1_AGAINST_1
public static final int METHOD_1_AGAINST_11-against-1- 另请参阅:
-
TAGS_METHOD
The error correction modes
-
-
构造器详细资料
-
MultiClassClassifier
public MultiClassClassifier()Constructor.
-
-
方法详细资料
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中SingleClassifierEnhancer
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Builds the classifiers.- 指定者:
buildClassifier
在类中Classifier
- 参数:
insts
- the training data.- 抛出:
Exception
- if a classifier can't be built
-
individualPredictions
Returns the individual predictions of the base classifiers for an instance. Used by StackedMultiClassClassifier. Returns the probability for the second "class" predicted by each base classifier.- 参数:
inst
- the instance to get the prediction for- 返回:
- the individual predictions
- 抛出:
Exception
- if the predictions can't be computed successfully
-
distributionForInstance
Returns the distribution for an instance.- 覆盖:
distributionForInstance
在类中Classifier
- 参数:
inst
- the instance to get the distribution for- 返回:
- the distribution
- 抛出:
Exception
- if the distribution can't be computed successfully
-
toString
Prints the classifiers. -
listOptions
Returns an enumeration describing the available options- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中RandomizableSingleClassifierEnhancer
- 返回:
- an enumeration of all the available options
-
setOptions
Parses a given list of options. 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)
-P Use pairwise coupling (only has an effect for 1-against1)
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.functions.Logistic)
Options specific to classifier weka.classifiers.functions.Logistic:
-D Turn on debugging output.
-R <ridge> Set the ridge in the log-likelihood.
-M <number> Set the maximum number of iterations (default -1, until convergence).
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中RandomizableSingleClassifierEnhancer
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the Classifier.- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中RandomizableSingleClassifierEnhancer
- 返回:
- an array of strings suitable for passing to setOptions
-
globalInfo
- 返回:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
randomWidthFactorTipText
- 返回:
- 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.- 返回:
- the width multiplier
-
setRandomWidthFactor
public void setRandomWidthFactor(double newRandomWidthFactor) Sets the multiplier when generating random codes. Will generate numClasses * m_RandomWidthFactor codes.- 参数:
newRandomWidthFactor
- the new width multiplier
-
methodTipText
- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getMethod
Gets the method used. Will be one of METHOD_1_AGAINST_ALL, METHOD_ERROR_RANDOM, METHOD_ERROR_EXHAUSTIVE, or METHOD_1_AGAINST_1.- 返回:
- the current method.
-
setMethod
Sets the method used. Will be one of METHOD_1_AGAINST_ALL, METHOD_ERROR_RANDOM, METHOD_ERROR_EXHAUSTIVE, or METHOD_1_AGAINST_1.- 参数:
newMethod
- the new method.
-
setUsePairwiseCoupling
public void setUsePairwiseCoupling(boolean p) Set whether to use pairwise coupling with 1-vs-1 classification to improve probability estimates.- 参数:
p
- true if pairwise coupling is to be used
-
getUsePairwiseCoupling
public boolean getUsePairwiseCoupling()Gets whether to use pairwise coupling with 1-vs-1 classification to improve probability estimates.- 返回:
- true if pairwise coupling is to be used
-
usePairwiseCouplingTipText
- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
pairwiseCoupling
public static double[] pairwiseCoupling(double[][] n, double[][] r) Implements pairwise coupling.- 参数:
n
- the sum of weights used to train each modelr
- the probability estimate from each model- 返回:
- the coupled estimates
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method for testing this class.- 参数:
argv
- the options
-