public class Vote extends RandomizableMultipleClassifiersCombiner implements TechnicalInformationHandler
-S <num> Random number seed. (default 1)
-B <classifier specification> Full class name of classifier to include, followed by scheme options. May be specified multiple times. (default: "weka.classifiers.rules.ZeroR")
-D If set, classifier is run in debug mode and may output additional info to the console
-R <AVG|PROD|MAJ|MIN|MAX|MED> The combination rule to use (default: AVG)BibTeX:
@book{Kuncheva2004, author = {Ludmila I. Kuncheva}, publisher = {John Wiley and Sons, Inc.}, title = {Combining Pattern Classifiers: Methods and Algorithms}, year = {2004} } @article{Kittler1998, author = {J. Kittler and M. Hatef and Robert P.W. Duin and J. Matas}, journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, number = {3}, pages = {226-239}, title = {On combining classifiers}, volume = {20}, year = {1998} }
Modifier and Type | Field and Description |
---|---|
static int |
AVERAGE_RULE
combination rule: Average of Probabilities
|
static int |
MAJORITY_VOTING_RULE
combination rule: Majority Voting (only nominal classes)
|
static int |
MAX_RULE
combination rule: Maximum Probability
|
static int |
MEDIAN_RULE
combination rule: Median Probability (only numeric class)
|
static int |
MIN_RULE
combination rule: Minimum Probability
|
static int |
PRODUCT_RULE
combination rule: Product of Probabilities (only nominal classes)
|
static Tag[] |
TAGS_RULES
combination rules
|
Constructor and Description |
---|
Vote() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Buildclassifier selects a classifier from the set of classifiers by
minimising error on the training data.
|
double |
classifyInstance(Instance instance)
Classifies the given test instance.
|
java.lang.String |
combinationRuleTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance instance)
Classifies a given instance using the selected combination rule.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
SelectedTag |
getCombinationRule()
Gets the combination rule used
|
java.lang.String[] |
getOptions()
Gets the current settings of Vote.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed
information about the technical background of this class, e.g., paper
reference or book this class is based on.
|
java.lang.String |
globalInfo()
Returns a string describing 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 |
setCombinationRule(SelectedTag newRule)
Sets the combination rule to use.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Output a representation of this classifier
|
getSeed, seedTipText, setSeed
classifiersTipText, getClassifier, getClassifiers, setClassifiers
debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
public static final int AVERAGE_RULE
public static final int PRODUCT_RULE
public static final int MAJORITY_VOTING_RULE
public static final int MIN_RULE
public static final int MAX_RULE
public static final int MEDIAN_RULE
public static final Tag[] TAGS_RULES
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableMultipleClassifiersCombiner
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class RandomizableMultipleClassifiersCombiner
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S <num> Random number seed. (default 1)
-B <classifier specification> Full class name of classifier to include, followed by scheme options. May be specified multiple times. (default: "weka.classifiers.rules.ZeroR")
-D If set, classifier is run in debug mode and may output additional info to the console
-R <AVG|PROD|MAJ|MIN|MAX|MED> The combination rule to use (default: AVG)
setOptions
in interface OptionHandler
setOptions
in class RandomizableMultipleClassifiersCombiner
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class MultipleClassifiersCombiner
Capabilities
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- the training data to be used for generating the boosted
classifier.java.lang.Exception
- if the classifier could not be built successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in class Classifier
instance
- the instance to be classifiedjava.lang.Exception
- if an error occurred during the predictionpublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classifiedjava.lang.Exception
- if instance could not be classified successfullypublic java.lang.String combinationRuleTipText()
public SelectedTag getCombinationRule()
public void setCombinationRule(SelectedTag newRule)
newRule
- the combination rule method to usepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(java.lang.String[] argv)
argv
- should contain the following arguments: -t training file [-T
test file] [-c class index]