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

Class weka.classifiers.functions.supportVector.SMOreg

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.functions.supportVector.SMOreg

public class SMOreg
extends Classifier
implements OptionHandler, WeightedInstancesHandler
Implements Alex J.Smola and Bernhard Scholkopf sequential minimal optimization algorithm for training a support vector regression using polynomial or RBF kernels. This implementation globally replaces all missing values and transforms nominal attributes into binary ones. It also normalizes all attributes by default. (Note that the coefficients in the output are based on the normalized/standardized data, not the original data.) For more information on the SMO algorithm, see

Alex J. Smola, Bernhard Scholkopf (1998). A Tutorial on Support Vector Regression. NeuroCOLT2 Technical Report Series - NC2-TR-1998-030.

S.K. Shevade, S.S. Keerthi, C. Bhattacharyya, K.R.K. Murthy, Improvements to SMO Algorithm for SVM Regression. Technical Report CD-99-16, Control Division Dept of Mechanical and Production Engineering, National University of Singapore.

Version:
$$
Author:
Sylvain Roy (sro33@student.canterbury.ac.nz)

Variable Index

 o FILTER_NONE
 
 o FILTER_NORMALIZE
The filter to apply to the training data
 o FILTER_STANDARDIZE
 
 o TAGS_FILTER
 

Constructor Index

 o SMOreg()
 

Method Index

 o buildClassifier(Instances)
Method for building the classifier.
 o classifyInstance(Instance)
Classifies a given instance.
 o getC()
Get the value of C.
 o getCacheSize()
Get the size of the kernel cache
 o getEps()
Get the value of eps.
 o getEpsilon()
Get the value of epsilon.
 o getExponent()
Get the value of exponent.
 o getFeatureSpaceNormalization()
Check whether feature spaces is being normalized.
 o getFilterType()
Gets how the training data will be transformed.
 o getGamma()
Get the value of gamma.
 o getLowerOrderTerms()
Check whether lower-order terms are being used.
 o getOptions()
Gets the current settings of the classifier.
 o getToleranceParameter()
Get the value of tolerance parameter.
 o getUseRBF()
Check if the RBF kernel is to be used.
 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 setCacheSize(int)
Set the value of the kernel cache.
 o setEps(double)
Set the value of eps.
 o setEpsilon(double)
Set the value of epsilon.
 o setExponent(double)
Set the value of exponent.
 o setFeatureSpaceNormalization(boolean)
Set whether feature space is normalized.
 o setFilterType(SelectedTag)
Sets how the training data will be transformed.
 o setGamma(double)
Set the value of gamma.
 o setLowerOrderTerms(boolean)
Set whether lower-order terms are to be used.
 o setOptions(String[])
Parses a given list of options.
 o setToleranceParameter(double)
Set the value of tolerance parameter.
 o setUseRBF(boolean)
Set if the RBF kernel is to be used.
 o toString()
Prints out the classifier.
 o turnChecksOff()
Turns off checks for missing values, etc.
 o turnChecksOn()
Turns on checks for missing values, etc.

Field Detail

 o FILTER_NORMALIZE
public static final int FILTER_NORMALIZE
          The filter to apply to the training data
 o FILTER_STANDARDIZE
public static final int FILTER_STANDARDIZE
 o FILTER_NONE
public static final int FILTER_NONE
 o TAGS_FILTER
public static final Tag[] TAGS_FILTER

Constructor Detail

 o SMOreg
public SMOreg()

Method Detail

 o buildClassifier
public void buildClassifier(Instances insts) throws java.lang.Exception
          Method for building the classifier.
Parameters:
insts - the set of training instances
Throws:
java.lang.Exception - if the classifier can't be built successfully
Overrides:
buildClassifier in class Classifier
 o classifyInstance
public double classifyInstance(Instance inst) throws java.lang.Exception
          Classifies a given instance.
Parameters:
instance - the instance to be classified
Returns:
the classification
Throws:
java.lang.Exception - if instance could not be classified successfully
Overrides:
classifyInstance in class Classifier
 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. Valid options are:

-S num
The amount up to which deviation are tolerated (epsilon). (default 1e-3) Watch out, the value of epsilon is used with the (normalized/standardize) data

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

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

-G num
Gamma for the RBF kernel. (default 0.01)

-N <0|1|2>
Whether to 0=normalize/1=standardize/2=neither. (default 0=normalize)

-F
Feature-space normalization (only for non-linear polynomial kernels).

-O
Use lower-order terms (only for non-linear polynomial kernels).

-R
Use RBF kernel (default poly).

-A num
Sets the size of the kernel cache. Should be a prime number. (default 1000003)

-T num
Sets the tolerance parameter. (default 1.0e-3)

-P num
Sets the epsilon for round-off error. (default 1.0e-12)

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 getFilterType
public SelectedTag getFilterType()
          Gets how the training data will be transformed. Will be one of FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.
Returns:
the filtering mode
 o setFilterType
public void setFilterType(SelectedTag newType)
          Sets how the training data will be transformed. Should be one of FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.
Parameters:
newType - the new filtering mode
 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. If linear kernel is used, rescaling and lower-order terms are turned off.
Parameters:
v - Value to assign to exponent.
 o getGamma
public double getGamma()
          Get the value of gamma.
Returns:
Value of gamma.
 o setGamma
public void setGamma(double v)
          Set the value of gamma.
Parameters:
v - Value to assign to gamma.
 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 getToleranceParameter
public double getToleranceParameter()
          Get the value of tolerance parameter.
Returns:
Value of tolerance parameter.
 o setToleranceParameter
public void setToleranceParameter(double v)
          Set the value of tolerance parameter.
Parameters:
v - Value to assign to tolerance parameter.
 o getEps
public double getEps()
          Get the value of eps.
Returns:
Value of eps.
 o setEps
public void setEps(double v)
          Set the value of eps.
Parameters:
v - Value to assign to epsilon.
 o getEpsilon
public double getEpsilon()
          Get the value of epsilon.
Returns:
Value of epsilon.
 o setEpsilon
public void setEpsilon(double v)
          Set the value of epsilon.
Parameters:
v - Value to assign to epsilon.
 o getCacheSize
public int getCacheSize()
          Get the size of the kernel cache
Returns:
Size of kernel cache.
 o setCacheSize
public void setCacheSize(int v)
          Set the value of the kernel cache.
Parameters:
v - Size of kernel cache.
 o getUseRBF
public boolean getUseRBF()
          Check if the RBF kernel is to be used.
Returns:
true if RBF
 o setUseRBF
public void setUseRBF(boolean v)
          Set if the RBF kernel is to be used.
Parameters:
v - true if RBF
 o getFeatureSpaceNormalization
public boolean getFeatureSpaceNormalization() throws java.lang.Exception
          Check whether feature spaces is being normalized.
Returns:
true if feature space is normalized.
 o setFeatureSpaceNormalization
public void setFeatureSpaceNormalization(boolean v) throws java.lang.Exception
          Set whether feature space is normalized.
Parameters:
v - true if feature space is to be normalized.
 o getLowerOrderTerms
public boolean getLowerOrderTerms()
          Check whether lower-order terms are being used.
Returns:
Value of lowerOrder.
 o setLowerOrderTerms
public void setLowerOrderTerms(boolean v)
          Set whether lower-order terms are to be used. Defaults to false if a linear machine is built.
Parameters:
v - Value to assign to lowerOrder.
 o turnChecksOff
public void turnChecksOff()
          Turns off checks for missing values, etc. Use with caution.
 o turnChecksOn
public void turnChecksOn()
          Turns on checks for missing values, etc.
 o toString
public java.lang.String toString()
          Prints out the classifier.
Returns:
a description of the classifier as a string
Overrides:
toString in class java.lang.Object
 o main
public static void main(java.lang.String argv[])
          Main method for testing this class.

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