public class Winnow
extends weka.classifiers.AbstractClassifier
implements weka.classifiers.UpdateableClassifier, weka.core.TechnicalInformationHandler
BibTeX:
@article{Littlestone1988, author = {N. Littlestone}, journal = {Machine Learning}, pages = {285-318}, title = {Learning quickly when irrelevant attributes are abound: A new linear threshold algorithm}, volume = {2}, year = {1988} } @techreport{Littlestone1989, address = {University of California, Santa Cruz}, author = {N. Littlestone}, institution = {University of California}, note = {Technical Report UCSC-CRL-89-11}, title = {Mistake bounds and logarithmic linear-threshold learning algorithms}, year = {1989} }
Valid options are:
-L Use the baLanced version (default false)
-I <int> 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)
-H <double> Prediction threshold. (default -1.0 == number of attributes)
-W <double> Starting weights. (default 2.0)
-S <int> Default random seed. (default 1)
Constructor and Description |
---|
Winnow() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
alphaTipText()
Returns the tip text for this property
|
java.lang.String |
balancedTipText()
Returns the tip text for this property
|
java.lang.String |
betaTipText()
Returns the tip text for this property
|
void |
buildClassifier(weka.core.Instances insts)
Builds the classifier
|
double |
classifyInstance(weka.core.Instance inst)
Outputs the prediction for the given instance.
|
java.lang.String |
defaultWeightTipText()
Returns the tip text for this property
|
double |
getAlpha()
Get the value of Alpha.
|
boolean |
getBalanced()
Get the value of Balanced.
|
double |
getBeta()
Get the value of Beta.
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
double |
getDefaultWeight()
Get the value of defaultWeight.
|
int |
getNumIterations()
Get the value of numIterations.
|
java.lang.String[] |
getOptions()
Gets the current settings of the classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getSeed()
Get the value of Seed.
|
weka.core.TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
double |
getThreshold()
Get the value of Threshold.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options
|
static void |
main(java.lang.String[] argv)
Main method.
|
java.lang.String |
numIterationsTipText()
Returns the tip text for this property
|
java.lang.String |
seedTipText()
Returns the tip text for this property
|
void |
setAlpha(double a)
Set the value of Alpha.
|
void |
setBalanced(boolean b)
Set the value of Balanced.
|
void |
setBeta(double b)
Set the value of Beta.
|
void |
setDefaultWeight(double w)
Set the value of defaultWeight.
|
void |
setNumIterations(int v)
Set the value of numIterations.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
Valid options are: |
void |
setSeed(int v)
Set the value of Seed.
|
void |
setThreshold(double t)
Set the value of Threshold.
|
java.lang.String |
thresholdTipText()
Returns the tip text for this property
|
java.lang.String |
toString()
Returns textual description of the classifier.
|
void |
updateClassifier(weka.core.Instance instance)
Updates the classifier with a new learning example
|
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
public java.lang.String globalInfo()
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.classifiers.AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Valid options are:
-L Use the baLanced version (default false)
-I <int> 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)
-H <double> Prediction threshold. (default -1.0 == number of attributes)
-W <double> Starting weights. (default 2.0)
-S <int> Default random seed. (default 1)
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.classifiers.AbstractClassifier
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
getOptions
in class weka.classifiers.AbstractClassifier
public weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.classifiers.Classifier
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.classifiers.AbstractClassifier
public void buildClassifier(weka.core.Instances insts) throws java.lang.Exception
buildClassifier
in interface weka.classifiers.Classifier
insts
- the data to train the classifier withjava.lang.Exception
- if something goes wrong during buildingpublic void updateClassifier(weka.core.Instance instance) throws java.lang.Exception
updateClassifier
in interface weka.classifiers.UpdateableClassifier
instance
- the instance to update the classifier withjava.lang.Exception
- if something goes wrongpublic double classifyInstance(weka.core.Instance inst) throws java.lang.Exception
classifyInstance
in interface weka.classifiers.Classifier
classifyInstance
in class weka.classifiers.AbstractClassifier
inst
- the instance for which prediction is to be computedjava.lang.Exception
- if something goes wrongpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String balancedTipText()
public boolean getBalanced()
public void setBalanced(boolean b)
b
- Value to assign to Balanced.public java.lang.String alphaTipText()
public double getAlpha()
public void setAlpha(double a)
a
- Value to assign to Alpha.public java.lang.String betaTipText()
public double getBeta()
public void setBeta(double b)
b
- Value to assign to Beta.public java.lang.String thresholdTipText()
public double getThreshold()
public void setThreshold(double t)
t
- Value to assign to Threshold.public java.lang.String defaultWeightTipText()
public double getDefaultWeight()
public void setDefaultWeight(double w)
w
- Value to assign to defaultWeight.public java.lang.String numIterationsTipText()
public int getNumIterations()
public void setNumIterations(int v)
v
- Value to assign to numIterations.public java.lang.String seedTipText()
public int getSeed()
public void setSeed(int v)
v
- Value to assign to Seed.public java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
getRevision
in class weka.classifiers.AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the commandline options