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

Class weka.classifiers.SMO

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

public class SMO
extends DistributionClassifier
implements OptionHandler
Implements John C. Platt's sequential minimal optimization algorithm for training a support vector classifier using scaled polynomial kernels. Transforms output of SVM into probabilities by applying a standard sigmoid function that is not fitted to the data. This implementation does not perform speed-up for linear feature space and sparse input data. It globally replaces all missing values, transforms nominal attributes into binary ones, and normalizes all numeric attributes. For more information on the SMO algorithm, see

J. Platt (1998). Fast Training of Support Vector Machines using Sequential Minimal Optimization. Advances in Kernel Methods - Support Vector Learning, B. Schölkopf, C. Burges, and A. Smola, eds., MIT Press.

Valid options are:

-C num
The complexity constant C. (default 1)

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

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

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

Constructor Index

 o SMO()

Method Index

 o buildClassifier(Instances)
Method for building the classifier.
 o distributionForInstance(Instance)
Outputs the distribution for the given output.
 o getC()
Get the value of C.
 o getExponent()
Get the value of exponent.
 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 for testing this class.
 o setC(double)
Set the value of C.
 o setExponent(double)
Set the value of exponent.
 o setOptions(String[])
Parses a given list of options.
 o setSeed(int)
Set the value of seed.
 o toString()
Prints out the classifier.

Constructors

 o SMO
 public SMO()

Methods

 o buildClassifier
 public void buildClassifier(Instances insts) throws Exception
Method for building the classifier.

Parameters:
insts - the set of training instances
Throws: Exception
if the classifier can't be built successfully
Overrides:
buildClassifier in class Classifier
 o distributionForInstance
 public double[] distributionForInstance(Instance inst) throws 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: Exception
if something goes wrong
Overrides:
distributionForInstance in class DistributionClassifier
 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options

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

-C num
The complexity constant C

-E num
The exponent for the polynomial kernel

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

Parameters:
options - the list of options as an array of strings
Throws: Exception
if an option is not supported
 o getOptions
 public String[] getOptions()
Gets the current settings of the classifier.

Returns:
an array of strings suitable for passing to setOptions
 o toString
 public String toString()
Prints out the classifier.

Returns:
a description of the classifier as a string
Overrides:
toString in class Object
 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 getC
 public double getC()
Get the value of C.

Returns:
Value of C.
 o setC
 public void setC(double v)
Set the value of C.

Parameters:
v - Value to assign to C.
 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(String argv[])
Main method for testing this class.


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