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

Class weka.classifiers.functions.Winnow

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.functions.Winnow

public class Winnow
extends Classifier
implements OptionHandler, UpdateableClassifier
Implements Winnow and Balanced Winnow algorithms by N. Littlestone. For more information, see

N. Littlestone (1988). Learning quickly when irrelevant attributes are abound: A new linear threshold algorithm. Machine Learning 2, pp. 285-318.

and N. Littlestone (1989). Mistake bounds and logarithmic linear-threshold learning algorithms. Technical report UCSC-CRL-89-11, University of California, Santa Cruz.

Valid options are:

-L
Use the baLanced variant (default: false)

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

-A double
Promotion coefficient alpha. (default 2.0)

-B double
Demotion coefficient beta. (default 0.5)

-W double
Starting weights of the prediction coeffs. (default 2.0)

-H double
Prediction threshold. (default -1.0 == number of attributes)

-S int
Random seed to shuffle the input. (default 1), -1 == no shuffling

Version:
$Revision: 1.6 $
Author:
J. Lindgren (jtlindgrcs.helsinki.fi)

Constructor Index

 o Winnow()
 

Method Index

 o buildClassifier(Instances)
Builds the classifier
 o classifyInstance(Instance)
Outputs the prediction for the given instance.
 o getAlpha()
Get the value of Alpha.
 o getBalanced()
Get the value of Balanced.
 o getBeta()
Get the value of Beta.
 o getDefaultWeight()
Get the value of defaultWeight.
 o getNumIterations()
Get the value of numIterations.
 o getOptions()
Gets the current settings of the classifier.
 o getSeed()
Get the value of Seed.
 o getThreshold()
Get the value of Threshold.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method.
 o setAlpha(double)
Set the value of Alpha.
 o setBalanced(boolean)
Set the value of Balanced.
 o setBeta(double)
Set the value of Beta.
 o setDefaultWeight(double)
Set the value of defaultWeight.
 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 setThreshold(double)
Set the value of Threshold.
 o toString()
Returns textual description of the classifier.
 o updateClassifier(Instance)
Updates the classifier with a new learning example

Constructor Detail

 o Winnow
public Winnow()

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.

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 classifier
Throws:
java.lang.Exception - if something goes wrong during building
Overrides:
buildClassifier in class Classifier
 o updateClassifier
public void updateClassifier(Instance instance) throws java.lang.Exception
          Updates the classifier with a new learning example
Throws:
java.lang.Exception - if something goes wrong
 o classifyInstance
public double classifyInstance(Instance inst) throws java.lang.Exception
          Outputs the prediction for the given instance.
Parameters:
inst - the instance for which prediction is to be computed
Returns:
the prediction
Throws:
java.lang.Exception - if something goes wrong
Overrides:
classifyInstance in class Classifier
 o toString
public java.lang.String toString()
          Returns textual description of the classifier.
Overrides:
toString in class java.lang.Object
 o getBalanced
public boolean getBalanced()
          Get the value of Balanced.
Returns:
Value of Balanced.
 o setBalanced
public void setBalanced(boolean b)
          Set the value of Balanced.
Parameters:
b - Value to assign to Balanced.
 o getAlpha
public double getAlpha()
          Get the value of Alpha.
Returns:
Value of Alpha.
 o setAlpha
public void setAlpha(double a)
          Set the value of Alpha.
Parameters:
a - Value to assign to Alpha.
 o getBeta
public double getBeta()
          Get the value of Beta.
Returns:
Value of Beta.
 o setBeta
public void setBeta(double b)
          Set the value of Beta.
Parameters:
b - Value to assign to Beta.
 o getThreshold
public double getThreshold()
          Get the value of Threshold.
Returns:
Value of Threshold.
 o setThreshold
public void setThreshold(double t)
          Set the value of Threshold.
Parameters:
t - Value to assign to Threshold.
 o getDefaultWeight
public double getDefaultWeight()
          Get the value of defaultWeight.
Returns:
Value of defaultWeight.
 o setDefaultWeight
public void setDefaultWeight(double w)
          Set the value of defaultWeight.
Parameters:
w - Value to assign to defaultWeight.
 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 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