weka.classifiers
Class Voter

java.lang.Object
  |
  +--weka.classifiers.Classifier
        |
        +--weka.classifiers.Voter
All Implemented Interfaces:
Cloneable, OptionHandler, Serializable

public class Voter
extends Classifier
implements OptionHandler

See Also:
Serialized Form

Constructor Summary
Voter()
           
 
Method Summary
 String accuracyTipText()
           
 void buildClassifier(Instances inst)
          Generates a classifier.
 double classifyInstance(Instance inst)
          Classifies a given instance.
 String debugTipText()
           
 double getAccuracy()
          Get the value of accuracy.
 int getDebug()
          Get the value of debug.
 String[] getOptions()
          Gets the current settings of the Classifier.
 Enumeration listOptions()
          Returns an enumeration of all the available options.
static void main(String[] args)
           
 void setAccuracy(double v)
          Set the value of accuracy.
 void setDebug(int v)
          Set the value of debug.
 void setOptions(String[] options)
          Parses a given list of options.
 String toString()
           
 
Methods inherited from class weka.classifiers.Classifier
forName, makeCopies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Voter

public Voter()
Method Detail

buildClassifier

public void buildClassifier(Instances inst)
                     throws Exception
Description copied from class: Classifier
Generates a classifier. Must initialize all fields of the classifier that are not being set via options (ie. multiple calls of buildClassifier must always lead to the same result). Must not change the dataset in any way.

Specified by:
buildClassifier in class Classifier
Parameters:
inst - set of instances serving as training data
Throws:
Exception - if the classifier has not been generated successfully

classifyInstance

public double classifyInstance(Instance inst)
                        throws Exception
Description copied from class: Classifier
Classifies a given instance.

Specified by:
classifyInstance in class Classifier
Parameters:
inst - the instance to be classified
Returns:
index of the predicted class as a double if the class is nominal, otherwise the predicted value
Throws:
Exception - if instance could not be classified successfully

getDebug

public int getDebug()
Get the value of debug.

Returns:
value of debug.

setDebug

public void setDebug(int v)
Set the value of debug.

Parameters:
v - Value to assign to debug.

debugTipText

public String debugTipText()

getAccuracy

public double getAccuracy()
Get the value of accuracy.

Returns:
value of accuracy.

setAccuracy

public void setAccuracy(double v)
Set the value of accuracy.

Parameters:
v - Value to assign to accuracy.

accuracyTipText

public String accuracyTipText()

listOptions

public Enumeration listOptions()
Description copied from interface: OptionHandler
Returns an enumeration of all the available options.

Specified by:
listOptions in interface OptionHandler
Returns:
an enumeration of all available options

setOptions

public void setOptions(String[] options)
                throws Exception
Parses a given list of options.

Specified by:
setOptions in interface OptionHandler
Parameters:
options - the list of options as an array of strings
Throws:
Exception - if an option is not supported

getOptions

public String[] getOptions()
Gets the current settings of the Classifier.

Specified by:
getOptions in interface OptionHandler
Returns:
an array of strings suitable for passing to setOptions

toString

public String toString()
Overrides:
toString in class Object

main

public static void main(String[] args)