Java Doc for SMOreg.java in  » Science » weka » weka » classifiers » functions » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » weka » weka.classifiers.functions 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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 $


Field Summary
final public static  intFILTER_NONE
    
final public static  intFILTER_NORMALIZE
    
final public static  intFILTER_STANDARDIZE
    
final public static  Tag[]TAGS_FILTER
    
protected  doublem_Alin
    
protected  doublem_Blin
    
protected  doublem_C
    
protected static  doublem_Del
    
protected  Filterm_Filter
     The filter used to standardize/normalize all values.
protected  SMOsetm_I0
    
protected  SMOsetm_I1
    
protected  SMOsetm_I2
    
protected  SMOsetm_I3
    
protected  booleanm_KernelIsLinear
    
protected  ReplaceMissingValuesm_Missing
     The filter used to get rid of missing values.
protected  NominalToBinarym_NominalToBinary
     The filter used to make attributes numeric.
protected  double[]m_alpha
    
protected  double[]m_alpha_
    
protected  doublem_bm_bLowm_bUp
     The thresholds.
protected  booleanm_checksTurnedOff
     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.
protected  intm_classIndex
    
protected  Instancesm_data
     The training data.
protected  doublem_eps
    
protected  doublem_epsilon
    
protected  double[]m_fcache
     The current set of errors for all non-bound examples.
protected  intm_filterType
    
protected  intm_iLowm_iUp
    
protected  Kernelm_kernel
    
protected  int[]m_sparseIndices
    
protected  double[]m_sparseWeights
     Variables to hold weight vector in sparse form.
protected  doublem_tol
    
protected  double[]m_weights
     Weight vector for linear machine.
final static  longserialVersionUID
    


Method Summary
public  voidbuildClassifier(Instances insts)
     Method for building the classifier.
public  StringcTipText()
    
protected  voidcheckAlphas()
    
protected  voidcheckOptimality()
     Debuggage function.
protected  voidcheckSets()
     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  StringchecksTurnedOffTipText()
    
public  doubleclassifyInstance(Instance inst)
     Classifies a given instance.
protected  voiddisplayB()
     Debuggage function Compute and display bLow, lUp and so on...
protected  voiddisplayStat(int i1, int i2)
     Debuggage function.
public  StringepsTipText()
    
public  StringepsilonTipText()
    
protected  intexamineExample(int i2)
     Examines instance.
public  StringfilterTypeTipText()
    
public  doublegetC()
     Get the value of C.
public  CapabilitiesgetCapabilities()
     Returns default capabilities of the classifier.
public  booleangetChecksTurnedOff()
     Returns whether the checks are turned off or not.
public  doublegetEps()
     Get the value of eps.
public  doublegetEpsilon()
     Get the value of epsilon.
public  SelectedTaggetFilterType()
     Gets how the training data will be transformed.
public  KernelgetKernel()
     Gets the kernel to use.
public  String[]getOptions()
     Gets the current settings of the classifier.
public  TechnicalInformationgetTechnicalInformation()
     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  doublegetToleranceParameter()
     Get the value of tolerance parameter.
public  StringglobalInfo()
    
public  StringkernelTipText()
    
public  EnumerationlistOptions()
     Returns an enumeration describing the available options.
public static  voidmain(String[] argv)
     Main method for testing this class.
protected  doubleobjFun()
     Debuggage function.
protected  doubleobjFun(int i1, int i2, double alpha1, double alpha1_, double alpha2, double alpha2_)
     Debuggage function.
public  voidsetC(double v)
     Set the value of C.
public  voidsetChecksTurnedOff(boolean value)
     Disables or enables the checks (which could be time-consuming).
public  voidsetEps(double v)
     Set the value of eps.
public  voidsetEpsilon(double v)
     Set the value of epsilon.
public  voidsetFilterType(SelectedTag newType)
     Sets how the training data will be transformed.
public  voidsetKernel(Kernel value)
     Sets the kernel to use.
public  voidsetOptions(String[] options)
     Parses a given list of options.
public  voidsetToleranceParameter(double v)
     Set the value of tolerance parameter.
protected  booleantakeStep(int i1, int i2)
     Method solving for the Lagrange multipliers for two instances.
public  StringtoString()
     Prints out the classifier.
public  StringtoleranceParameterTipText()
    
public  voidturnChecksOff()
     Turns off checks for missing values, etc.
public  voidturnChecksOn()
     Turns on checks for missing values, etc.

Field Detail
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_Missing
protected ReplaceMissingValues m_Missing(Code)
The filter used to get rid of missing values.



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_data
protected Instances m_data(Code)
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_kernel
protected Kernel m_kernel(Code)
Kernel to use *



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





Method Detail
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)

Methods inherited from weka.classifiers.Classifier
abstract public void buildClassifier(Instances data) throws Exception(Code)(Java Doc)
public double classifyInstance(Instance instance) throws Exception(Code)(Java Doc)
public String debugTipText()(Code)(Java Doc)
public double[] distributionForInstance(Instance instance) throws Exception(Code)(Java Doc)
public static Classifier forName(String classifierName, String[] options) throws Exception(Code)(Java Doc)
public Capabilities getCapabilities()(Code)(Java Doc)
public boolean getDebug()(Code)(Java Doc)
public String[] getOptions()(Code)(Java Doc)
public Enumeration listOptions()(Code)(Java Doc)
public static Classifier[] makeCopies(Classifier model, int num) throws Exception(Code)(Java Doc)
public static Classifier makeCopy(Classifier model) throws Exception(Code)(Java Doc)
protected static void runClassifier(Classifier classifier, String[] options)(Code)(Java Doc)
public void setDebug(boolean debug)(Code)(Java Doc)
public void setOptions(String[] options) throws Exception(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.