weka.classifiers.meta
Class Vote

java.lang.Object
  extended byweka.classifiers.Classifier
      extended byweka.classifiers.MultipleClassifiersCombiner
          extended byweka.classifiers.meta.Vote
All Implemented Interfaces:
java.lang.Cloneable, OptionHandler, java.io.Serializable

public class Vote
extends MultipleClassifiersCombiner

Class for combining classifiers using unweighted average of probability estimates (classification) or numeric predictions (regression). Valid options from the command line are:

-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.6 $
Author:
Alexander K. Seewald (alex@seewald.at), Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class weka.classifiers.MultipleClassifiersCombiner
m_Classifiers
 
Fields inherited from class weka.classifiers.Classifier
m_Debug
 
Constructor Summary
Vote()
           
 
Method Summary
 void buildClassifier(Instances data)
          Buildclassifier selects a classifier from the set of classifiers by minimising error on the training data.
 double[] distributionForInstance(Instance instance)
          Classifies a given instance using the selected classifier.
 java.lang.String globalInfo()
          Returns a string describing classifier
static void main(java.lang.String[] argv)
          Main method for testing this class.
 java.lang.String toString()
          Output a representation of this classifier
 
Methods inherited from class weka.classifiers.MultipleClassifiersCombiner
classifiersTipText, getClassifier, getClassifiers, getClassifierSpec, getOptions, listOptions, setClassifiers, setOptions
 
Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vote

public Vote()
Method Detail

globalInfo

public java.lang.String globalInfo()
Returns a string describing classifier

Returns:
a description suitable for displaying in the explorer/experimenter gui

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.

Specified by:
buildClassifier in class Classifier
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

distributionForInstance

public double[] distributionForInstance(Instance instance)
                                 throws java.lang.Exception
Classifies a given instance using the selected classifier.

Overrides:
distributionForInstance in class Classifier
Parameters:
instance - the instance to be classified
Returns:
an array containing the estimated membership probabilities of the test instance in each class or the numeric prediction
Throws:
java.lang.Exception - if instance could not be classified successfully

toString

public java.lang.String toString()
Output a representation of this classifier


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]