|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.DistributionClassifier | +--weka.classifiers.VotedPerceptron
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)
Constructor Summary | |
VotedPerceptron()
|
Method Summary | |
void |
buildClassifier(Instances insts)
Builds the ensemble of perceptrons. |
double[] |
distributionForInstance(Instance inst)
Outputs the distribution for the given output. |
double |
getExponent()
Get the value of exponent. |
int |
getMaxK()
Get the value of maxK. |
int |
getNumIterations()
Get the value of NumIterations. |
String[] |
getOptions()
Gets the current settings of the classifier. |
int |
getSeed()
Get the value of Seed. |
Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(String[] argv)
Main method. |
void |
setExponent(double v)
Set the value of exponent. |
void |
setMaxK(int v)
Set the value of maxK. |
void |
setNumIterations(int v)
Set the value of NumIterations. |
void |
setOptions(String[] options)
Parses a given list of options. |
void |
setSeed(int v)
Set the value of Seed. |
String |
toString()
Returns textual description of classifier. |
Methods inherited from class weka.classifiers.DistributionClassifier |
classifyInstance |
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 |
public VotedPerceptron()
Method Detail |
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-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)
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
Exception
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public void buildClassifier(Instances insts) throws Exception
buildClassifier
in class Classifier
insts
- set of instances serving as training data
Exception
- if something goes wrong during buildingpublic double[] distributionForInstance(Instance inst) throws Exception
distributionForInstance
in class DistributionClassifier
inst
- the instance for which distribution is to be computed
Exception
- if something goes wrongpublic String toString()
toString
in class Object
public int getMaxK()
public void setMaxK(int v)
v
- Value to assign to maxK.public int getNumIterations()
public void setNumIterations(int v)
v
- Value to assign to NumIterations.public double getExponent()
public void setExponent(double v)
v
- Value to assign to exponent.public int getSeed()
public void setSeed(int v)
v
- Value to assign to Seed.public static void main(String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |