| java.lang.Object weka.classifiers.Classifier weka.classifiers.functions.SMOreg
SMOreg | public class SMOreg extends Classifier implements OptionHandler,WeightedInstancesHandler,TechnicalInformationHandler(Code) | |
Implements Alex Smola and Bernhard Scholkopf's sequential minimal optimization algorithm for training a support vector regression model. 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 Schoelkopf: A Tutorial on Support Vector Regression. In NeuroCOLT2 Technical Report Series, 1998.
S.K. Shevade, S.S. Keerthi, C. Bhattacharyya, K.R.K. Murthy (1999). Improvements to SMO Algorithm for SVM Regression. Control Division Dept of Mechanical and Production Engineering, National University of Singapore.
BibTeX:
@incollection{Smola1998,
author = {Alex J. Smola and Bernhard Schoelkopf},
booktitle = {NeuroCOLT2 Technical Report Series},
note = {NC2-TR-1998-030},
title = {A Tutorial on Support Vector Regression},
year = {1998}
}
@techreport{Shevade1999,
address = {Control Division Dept of Mechanical and Production Engineering, National University of Singapore},
author = {S.K. Shevade and S.S. Keerthi and C. Bhattacharyya and K.R.K. Murthy},
institution = {National University of Singapore},
note = {Technical Report CD-99-16},
title = {Improvements to SMO Algorithm for SVM Regression},
year = {1999}
}
Valid options are:
-D
If set, classifier is run in debug mode and
may output additional info to the console
-no-checks
Turns off all checks - use with caution!
Turning them off assumes that data is purely numeric, doesn't
contain any missing values, and has a nominal class. Turning them
off also means that no header information will be stored if the
machine is linear. Finally, it also assumes that no instance has
a weight equal to 0.
(default: checks on)
-S <double>
The amount up to which deviations are
tolerated (epsilon). (default 1e-3)
-C <double>
The complexity constant C. (default 1)
-N
Whether to 0=normalize/1=standardize/2=neither. (default 0=normalize)
-T <double>
The tolerance parameter. (default 1.0e-3)
-P <double>
The epsilon for round-off error. (default 1.0e-12)
-K <classname and parameters>
The Kernel to use.
(default: weka.classifiers.functions.supportVector.PolyKernel)
Options specific to kernel weka.classifiers.functions.supportVector.PolyKernel:
-D
Enables debugging output (if available) to be printed.
(default: off)
-no-checks
Turns off all checks - use with caution!
(default: checks on)
-C <num>
The size of the cache (a prime number).
(default: 250007)
-E <num>
The Exponent to use.
(default: 1.0)
-L
Use lower-order terms.
(default: no)
author: Sylvain Roy (sro33@student.canterbury.ac.nz) version: $Revision: 1.12 $ |
Method Summary | |
public void | buildClassifier(Instances insts) Method for building the classifier. | public String | cTipText() | protected void | checkAlphas() | protected void | checkOptimality() Debuggage function. | protected void | checkSets() Debuggage function.
Check that the set I0, I1, I2 and I3 cover the whole set of index
and that no attribute appears in two different sets. | public String | checksTurnedOffTipText() | public double | classifyInstance(Instance inst) Classifies a given instance. | protected void | displayB() Debuggage function
Compute and display bLow, lUp and so on... | protected void | displayStat(int i1, int i2) Debuggage function. | public String | epsTipText() | public String | epsilonTipText() | protected int | examineExample(int i2) Examines instance. | public String | filterTypeTipText() | public double | getC() Get the value of C. | public Capabilities | getCapabilities() Returns default capabilities of the classifier. | public boolean | getChecksTurnedOff() Returns whether the checks are turned off or not. | public double | getEps() Get the value of eps. | public double | getEpsilon() Get the value of epsilon. | public SelectedTag | getFilterType() Gets how the training data will be transformed. | public Kernel | getKernel() Gets the kernel to use. | public String[] | getOptions() Gets the current settings of the classifier. | public 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. | public double | getToleranceParameter() Get the value of tolerance parameter. | public String | globalInfo() | public String | kernelTipText() | public Enumeration | listOptions() Returns an enumeration describing the available options. | public static void | main(String[] argv) Main method for testing this class. | protected double | objFun() Debuggage function. | protected double | objFun(int i1, int i2, double alpha1, double alpha1_, double alpha2, double alpha2_) Debuggage function. | public void | setC(double v) Set the value of C. | public void | setChecksTurnedOff(boolean value) Disables or enables the checks (which could be time-consuming). | public void | setEps(double v) Set the value of eps. | public void | setEpsilon(double v) Set the value of epsilon. | public void | setFilterType(SelectedTag newType) Sets how the training data will be transformed. | public void | setKernel(Kernel value) Sets the kernel to use. | public void | setOptions(String[] options) Parses a given list of options. | public void | setToleranceParameter(double v) Set the value of tolerance parameter. | protected boolean | takeStep(int i1, int i2) Method solving for the Lagrange multipliers for
two instances. | public String | toString() Prints out the classifier. | public String | toleranceParameterTipText() | public void | turnChecksOff() Turns off checks for missing values, etc. | public void | turnChecksOn() Turns on checks for missing values, etc. |
FILTER_NONE | final public static int FILTER_NONE(Code) | | no filtering
|
FILTER_NORMALIZE | final public static int FILTER_NORMALIZE(Code) | | normalize data
|
FILTER_STANDARDIZE | final public static int FILTER_STANDARDIZE(Code) | | standardize data
|
TAGS_FILTER | final public static Tag[] TAGS_FILTER(Code) | | The filter to apply to the training data
|
m_Alin | protected double m_Alin(Code) | | The parameters of the linear transforamtion realized
by the filter on the class attribute
|
m_Blin | protected double m_Blin(Code) | | |
m_C | protected double m_C(Code) | | The complexity parameter
|
m_Del | protected static double m_Del(Code) | | Precision constant for updating sets
|
m_Filter | protected Filter m_Filter(Code) | | The filter used to standardize/normalize all values.
|
m_I0 | protected SMOset m_I0(Code) | | {i: 0 < m_alpha[i] < C || 0 < m_alpha_[i] < C}
|
m_I1 | protected SMOset m_I1(Code) | | {i: m_class[i] = 0, m_alpha_[i] = 0}
|
m_I2 | protected SMOset m_I2(Code) | | {i: m_class[i] = 0, m_alpha_[i] = C}
|
m_I3 | protected SMOset m_I3(Code) | | {i: m_class[i] = C, m_alpha_[i] = 0}
|
m_KernelIsLinear | protected boolean m_KernelIsLinear(Code) | | whether the kernel is a linear one
|
m_NominalToBinary | protected NominalToBinary m_NominalToBinary(Code) | | The filter used to make attributes numeric.
|
m_alpha | protected double[] m_alpha(Code) | | The Lagrange multipliers
|
m_alpha_ | protected double[] m_alpha_(Code) | | |
m_bm_bLowm_bUp | protected double m_bm_bLowm_bUp(Code) | | The thresholds.
|
m_checksTurnedOff | protected boolean m_checksTurnedOff(Code) | | Turn off all checks and conversions? Turning them off assumes
that data is purely numeric, doesn't contain any missing values,
and has a numeric class. Turning them off also means that
no header information will be stored if the machine is linear.
Finally, it also assumes that no instance has a weight equal to 0.
|
m_classIndex | protected int m_classIndex(Code) | | The class index from the training data
|
m_eps | protected double m_eps(Code) | | The parameter eps
|
m_epsilon | protected double m_epsilon(Code) | | The parameter epsilon
|
m_fcache | protected double[] m_fcache(Code) | | The current set of errors for all non-bound examples.
|
m_filterType | protected int m_filterType(Code) | | Whether to normalize/standardize/neither
|
m_iLowm_iUp | protected int m_iLowm_iUp(Code) | | The indices for m_bLow and m_bUp
|
m_sparseIndices | protected int[] m_sparseIndices(Code) | | |
m_sparseWeights | protected double[] m_sparseWeights(Code) | | Variables to hold weight vector in sparse form.
(To reduce storage requirements.)
|
m_tol | protected double m_tol(Code) | | The parameter tol
|
m_weights | protected double[] m_weights(Code) | | Weight vector for linear machine.
|
serialVersionUID | final static long serialVersionUID(Code) | | for serialization
|
buildClassifier | public void buildClassifier(Instances insts) throws Exception(Code) | | Method for building the classifier.
Parameters: insts - the set of training instances throws: Exception - if the classifier can't be built successfully |
cTipText | public String cTipText()(Code) | | Returns the tip text for this property
tip text for this property suitable fordisplaying in the explorer/experimenter gui |
checkAlphas | protected void checkAlphas() throws Exception(Code) | | Debuggage function
Checks that :
alpha*alpha_=0
sum(alpha[i] - alpha_[i]) = 0
throws: Exception - if check fails |
checkOptimality | protected void checkOptimality() throws Exception(Code) | | Debuggage function.
Checks if the equations (6), (8a), (8b), (8c), (8d) hold.
(Refers to "Improvements to SMO Algorithm for SVM Regression".)
Prints warnings for each equation which doesn't hold.
throws: Exception - if check fails |
checkSets | protected void checkSets() throws Exception(Code) | | Debuggage function.
Check that the set I0, I1, I2 and I3 cover the whole set of index
and that no attribute appears in two different sets.
throws: Exception - if check fails |
checksTurnedOffTipText | public String checksTurnedOffTipText()(Code) | | Returns the tip text for this property
tip text for this property suitable fordisplaying in the explorer/experimenter gui |
classifyInstance | public double classifyInstance(Instance inst) throws Exception(Code) | | Classifies a given instance.
Parameters: inst - the instance to be classified the classification throws: Exception - if instance could not be classifiedsuccessfully |
displayB | protected void displayB() throws Exception(Code) | | Debuggage function
Compute and display bLow, lUp and so on...
throws: Exception - if display fails |
displayStat | protected void displayStat(int i1, int i2) throws Exception(Code) | | Debuggage function.
Display the current status of the program.
Parameters: i1 - the first current indice Parameters: i2 - the second current indice throws: Exception - if printing of current status fails |
epsTipText | public String epsTipText()(Code) | | Returns the tip text for this property
tip text for this property suitable fordisplaying in the explorer/experimenter gui |
epsilonTipText | public String epsilonTipText()(Code) | | Returns the tip text for this property
tip text for this property suitable fordisplaying in the explorer/experimenter gui |
examineExample | protected int examineExample(int i2) throws Exception(Code) | | Examines instance. (As defined in Shevade's paper.)
Parameters: i2 - index of instance to examine true if examination was successfull throws: Exception - if something goes wrong |
filterTypeTipText | public String filterTypeTipText()(Code) | | Returns the tip text for this property
tip text for this property suitable fordisplaying in the explorer/experimenter gui |
getC | public double getC()(Code) | | Get the value of C.
Value of C. |
getCapabilities | public Capabilities getCapabilities()(Code) | | Returns default capabilities of the classifier.
the capabilities of this classifier |
getChecksTurnedOff | public boolean getChecksTurnedOff()(Code) | | Returns whether the checks are turned off or not.
true if the checks are turned off |
getEps | public double getEps()(Code) | | Get the value of eps.
Value of eps. |
getEpsilon | public double getEpsilon()(Code) | | Get the value of epsilon.
Value of epsilon. |
getFilterType | public SelectedTag getFilterType()(Code) | | Gets how the training data will be transformed. Will be one of
FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.
the filtering mode |
getKernel | public Kernel getKernel()(Code) | | Gets the kernel to use.
the kernel |
getOptions | public String[] getOptions()(Code) | | Gets the current settings of the classifier.
an array of strings suitable for passing to setOptions |
getTechnicalInformation | public TechnicalInformation getTechnicalInformation()(Code) | | 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.
the technical information about this class |
getToleranceParameter | public double getToleranceParameter()(Code) | | Get the value of tolerance parameter.
Value of tolerance parameter. |
globalInfo | public String globalInfo()(Code) | | Returns a string describing classifier
a description suitable fordisplaying in the explorer/experimenter gui |
kernelTipText | public String kernelTipText()(Code) | | Returns the tip text for this property
tip text for this property suitable fordisplaying in the explorer/experimenter gui |
listOptions | public Enumeration listOptions()(Code) | | Returns an enumeration describing the available options.
an enumeration of all the available options. |
main | public static void main(String[] argv)(Code) | | Main method for testing this class.
Parameters: argv - the commandline options |
objFun | protected double objFun() throws Exception(Code) | | Debuggage function.
Compute the value of the objective function.
the value of the objective function throws: Exception - if computation fails |
objFun | protected double objFun(int i1, int i2, double alpha1, double alpha1_, double alpha2, double alpha2_) throws Exception(Code) | | Debuggage function.
Compute the value of the objective function.
Parameters: i1 - Parameters: i2 - Parameters: alpha1 - Parameters: alpha1_ - Parameters: alpha2 - Parameters: alpha2_ - throws: Exception - if something goes wrong |
setC | public void setC(double v)(Code) | | Set the value of C.
Parameters: v - Value to assign to C. |
setChecksTurnedOff | public void setChecksTurnedOff(boolean value)(Code) | | Disables or enables the checks (which could be time-consuming). Use with
caution!
Parameters: value - if true turns off all checks |
setEps | public void setEps(double v)(Code) | | Set the value of eps.
Parameters: v - Value to assign to epsilon. |
setEpsilon | public void setEpsilon(double v)(Code) | | Set the value of epsilon.
Parameters: v - Value to assign to epsilon. |
setFilterType | public void setFilterType(SelectedTag newType)(Code) | | Sets how the training data will be transformed. Should be one of
FILTER_NORMALIZE, FILTER_STANDARDIZE, FILTER_NONE.
Parameters: newType - the new filtering mode |
setKernel | public void setKernel(Kernel value)(Code) | | Sets the kernel to use.
Parameters: value - the kernel |
setOptions | public void setOptions(String[] options) throws Exception(Code) | | Parses a given list of options.
Parameters: options - the list of options as an array of strings throws: Exception - if an option is not supported |
setToleranceParameter | public void setToleranceParameter(double v)(Code) | | Set the value of tolerance parameter.
Parameters: v - Value to assign to tolerance parameter. |
takeStep | protected boolean takeStep(int i1, int i2) throws Exception(Code) | | Method solving for the Lagrange multipliers for
two instances. (As defined in Shevade's paper.)
Parameters: i1 - index of the first instance Parameters: i2 - index of the second instance true if multipliers could be found throws: Exception - if something goes wrong |
toString | public String toString()(Code) | | Prints out the classifier.
a description of the classifier as a string |
toleranceParameterTipText | public String toleranceParameterTipText()(Code) | | Returns the tip text for this property
tip text for this property suitable fordisplaying in the explorer/experimenter gui |
turnChecksOff | public void turnChecksOff()(Code) | | Turns off checks for missing values, etc. Use with caution.
|
turnChecksOn | public void turnChecksOn()(Code) | | Turns on checks for missing values, etc.
|
Fields inherited from weka.classifiers.Classifier | protected boolean m_Debug(Code)(Java Doc)
|
|
|