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)
-
SMO()
-
-
buildClassifier(Instances)
- Method for building the classifier.
-
distributionForInstance(Instance)
- Outputs the distribution for the given output.
-
getC()
- Get the value of C.
-
getExponent()
- Get the value of exponent.
-
getOptions()
- Gets the current settings of the classifier.
-
getSeed()
- Get the value of seed.
-
listOptions()
- Returns an enumeration describing the available options
-
main(String[])
- Main method for testing this class.
-
setC(double)
- Set the value of C.
-
setExponent(double)
- Set the value of exponent.
-
setOptions(String[])
- Parses a given list of options.
-
setSeed(int)
- Set the value of seed.
-
toString()
- Prints out the classifier.
SMO
public SMO()
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
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
listOptions
public Enumeration listOptions()
- Returns an enumeration describing the available options
- Returns:
- an enumeration of all the available options
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
getOptions
public String[] getOptions()
- Gets the current settings of the classifier.
- Returns:
- an array of strings suitable for passing to setOptions
toString
public String toString()
- Prints out the classifier.
- Returns:
- a description of the classifier as a string
- Overrides:
- toString in class Object
getExponent
public double getExponent()
- Get the value of exponent.
- Returns:
- Value of exponent.
setExponent
public void setExponent(double v)
- Set the value of exponent.
- Parameters:
- v - Value to assign to exponent.
getC
public double getC()
- Get the value of C.
- Returns:
- Value of C.
setC
public void setC(double v)
- Set the value of C.
- Parameters:
- v - Value to assign to C.
getSeed
public int getSeed()
- Get the value of seed.
- Returns:
- Value of seed.
setSeed
public void setSeed(int v)
- Set the value of seed.
- Parameters:
- v - Value to assign to seed.
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