All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.VotedPerceptron

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.DistributionClassifier
                    |
                    +----weka.classifiers.VotedPerceptron

public class VotedPerceptron
extends DistributionClassifier
implements OptionHandler
Implements the voted perceptron algorithm by Freund and Schapire. Globally replaces all missing values, and transforms nominal attributes into binary ones. For more information, see

Y. Freund and R. E. Schapire (1998). Large margin classification using the perceptron algorithm. Proc. 11th Annu. Conf. on Comput. Learning Theory, pp. 209-217, ACM Press, New York, NY.

Valid options are:

-I num
The number of iterations to be performed. (default 1)

-E num
The exponent for the polynomial kernel. (default 1)

-S num
The seed for the random number generator. (default 1)

-M num
The maximum number of alterations allowed. (default 10000)

Version:
$Revision: 1.10 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)

Constructor Index

 o VotedPerceptron()
 

Method Index

 o buildClassifier(Instances)
Builds the ensemble of perceptrons.
 o distributionForInstance(Instance)
Outputs the distribution for the given output.
 o getExponent()
Get the value of exponent.
 o getMaxK()
Get the value of maxK.
 o getNumIterations()
Get the value of NumIterations.
 o getOptions()
Gets the current settings of the classifier.
 o getSeed()
Get the value of Seed.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method.
 o setExponent(double)
Set the value of exponent.
 o setMaxK(int)
Set the value of maxK.
 o setNumIterations(int)
Set the value of NumIterations.
 o setOptions(String[])
Parses a given list of options.
 o setSeed(int)
Set the value of Seed.
 o toString()
Returns textual description of classifier.

Constructor Detail

 o VotedPerceptron
public VotedPerceptron()

Method Detail

 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
Returns:
an enumeration of all the available options
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are:

-I num
The number of iterations to be performed. (default 1)

-E num
The exponent for the polynomial kernel. (default 1)

-S num
The seed for the random number generator. (default 1)

-M num
The maximum number of alterations allowed. (default 10000)

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of the classifier.
Returns:
an array of strings suitable for passing to setOptions
 o buildClassifier
public void buildClassifier(Instances insts) throws java.lang.Exception
          Builds the ensemble of perceptrons.
Throws:
java.lang.Exception - if something goes wrong during building
Overrides:
buildClassifier in class Classifier
 o distributionForInstance
public double[] distributionForInstance(Instance inst) throws java.lang.Exception
          Outputs the distribution for the given output. Pipes output of SVM through sigmoid function.
Parameters:
inst - the instance for which distribution is to be computed
Returns:
the distribution
Throws:
java.lang.Exception - if something goes wrong
Overrides:
distributionForInstance in class DistributionClassifier
 o toString
public java.lang.String toString()
          Returns textual description of classifier.
Overrides:
toString in class java.lang.Object
 o getMaxK
public int getMaxK()
          Get the value of maxK.
Returns:
Value of maxK.
 o setMaxK
public void setMaxK(int v)
          Set the value of maxK.
Parameters:
v - Value to assign to maxK.
 o getNumIterations
public int getNumIterations()
          Get the value of NumIterations.
Returns:
Value of NumIterations.
 o setNumIterations
public void setNumIterations(int v)
          Set the value of NumIterations.
Parameters:
v - Value to assign to NumIterations.
 o getExponent
public double getExponent()
          Get the value of exponent.
Returns:
Value of exponent.
 o setExponent
public void setExponent(double v)
          Set the value of exponent.
Parameters:
v - Value to assign to exponent.
 o getSeed
public int getSeed()
          Get the value of Seed.
Returns:
Value of Seed.
 o setSeed
public void setSeed(int v)
          Set the value of Seed.
Parameters:
v - Value to assign to Seed.
 o main
public static void main(java.lang.String argv[])
          Main method.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home