All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.classifiers.meta.Vote
java.lang.Object
|
+----weka.classifiers.Classifier
|
+----weka.classifiers.DistributionClassifier
|
+----weka.classifiers.meta.Vote
- public class Vote
- extends DistributionClassifier
- implements OptionHandler
Class for combining classifiers using unweighted average (i.e. Voting)
Valid options from the command line are:
-D
Turn on debugging output.
-S seed
Random number seed (default 1).
-B classifierstring
Classifierstring should contain the full class name of a scheme
included for selection followed by options to the classifier
(required, option should be used once for each classifier).
- Version:
- $Revision: 1.1 $
- Author:
- Alexander K. Seewald (alex@seewald.at)
Vote()
-
buildClassifier(Instances)
- Buildclassifier selects a classifier from the set of classifiers
by minimising error on the training data.
distributionForInstance(Instance)
- Classifies a given instance using the selected classifier.
getClassifier(int)
- Gets a single classifier from the set of available classifiers.
getClassifiers()
- Gets the list of possible classifers to choose from.
getDebug()
- Get whether debugging is turned on
getOptions()
- Gets the current settings of the Classifier.
getSeed()
- Gets the random number seed.
listOptions()
- Returns an enumeration describing the available options
main(String[])
- Main method for testing this class.
setClassifiers(Classifier[])
- Sets the list of possible classifers to choose from.
setDebug(boolean)
- Set debugging mode
setOptions(String[])
- Parses a given list of options.
setSeed(int)
- Sets the seed for random number generation.
toString()
- Output a representation of this classifier
Vote
public Vote()
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration describing the available options
- Returns:
- an enumeration of all the available options
setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
Parses a given list of options. Valid options are:
-D
Turn on debugging output.
-S seed
Random number seed (default 1).
-B classifierstring
Classifierstring should contain the full class name of a scheme
included for selection followed by options to the classifier
(required, option should be used once for each classifier).
- Parameters:
options - the list of options as an array of strings
- Throws:
- java.lang.Exception - if an option is not supported
getOptions
public java.lang.String[] getOptions()
Gets the current settings of the Classifier.
- Returns:
- an array of strings suitable for passing to setOptions
setClassifiers
public void setClassifiers(Classifier classifiers[])
Sets the list of possible classifers to choose from.
- Parameters:
classifiers - an array of classifiers with all options set.
getClassifiers
public Classifier[] getClassifiers()
Gets the list of possible classifers to choose from.
- Returns:
- the array of Classifiers
getClassifier
public Classifier getClassifier(int index)
Gets a single classifier from the set of available classifiers.
- Parameters:
index - the index of the classifier wanted
- Returns:
- the Classifier
setSeed
public void setSeed(int seed)
Sets the seed for random number generation.
- Parameters:
seed - the random number seed
getSeed
public int getSeed()
Gets the random number seed.
- Returns:
- the random number seed
setDebug
public void setDebug(boolean debug)
Set debugging mode
- Parameters:
debug - true if debug output should be printed
getDebug
public boolean getDebug()
Get whether debugging is turned on
- Returns:
- true if debugging output is on
buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
Buildclassifier selects a classifier from the set of classifiers
by minimising error on the training data.
- Parameters:
data - the training data to be used for generating the
boosted classifier.
- Throws:
- java.lang.Exception - if the classifier could not be built successfully
- Overrides:
- buildClassifier in class Classifier
distributionForInstance
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
Classifies a given instance using the selected classifier.
- Parameters:
instance - the instance to be classified
- Throws:
- java.lang.Exception - if instance could not be classified
successfully
- Overrides:
- distributionForInstance in class DistributionClassifier
toString
public java.lang.String toString()
Output a representation of this classifier
- Overrides:
- toString in class java.lang.Object
main
public static void main(java.lang.String argv[])
Main method for testing this class.
- Parameters:
argv - should contain the following arguments:
-t training file [-T test file] [-c class index]
All Packages Class Hierarchy This Package Previous Next Index WEKA's home