Class RegOptimizer
java.lang.Object
weka.classifiers.functions.supportVector.RegOptimizer
- All Implemented Interfaces:
Serializable,OptionHandler,RevisionHandler
- Direct Known Subclasses:
RegSMO
Base class implementation for learning algorithm of SMOreg
Valid options are:
-L <double> The epsilon parameter in epsilon-insensitive loss function. (default 1.0e-3)
-W <double> The random number seed. (default 1)
- Version:
- $Revision: 15562 $
- Author:
- Remco Bouckaert (remco@cs.waikato.ac.nz,rrb@xm.co.nz)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptiondouble[]alpha and alpha* arrays containing weights for solving dual problemdouble[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildClassifier(Instances data) learn SVM parameters from data.Returns the tip text for this propertyintreturn the number of kernel cache hitsdoubleGet the value of epsilon parameter of the epsilon insensitive loss function.longreturns the number of kernel evaluationsString[]Gets the current settings of the classifier.Returns the revision string.intgetSeed()Gets the current seed value for the random number generatorGets an enumeration describing the available options.booleanflag to indicate whether the model was built yetReturns the tip text for this propertyvoidsetEpsilonParameter(double v) Set the value of epsilon parameter of the epsilon insensitive loss function.voidsetOptions(String[] options) Parses a given list of options.voidsetSeed(int value) Sets the seed value for the random number generatorvoidsets the parent SVMdoubletoString()Prints out the classifier.
-
Field Details
-
m_alpha
public double[] m_alphaalpha and alpha* arrays containing weights for solving dual problem -
m_alphaStar
public double[] m_alphaStar
-
-
Constructor Details
-
RegOptimizer
public RegOptimizer()the default constructor
-
-
Method Details
-
listOptions
Gets an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-L <double> The epsilon parameter in epsilon-insensitive loss function. (default 1.0e-3)
-W <double> The random number seed. (default 1)
- Specified by:
setOptionsin interfaceOptionHandler- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
Gets the current settings of the classifier.- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- an array of strings suitable for passing to setOptions
-
modelBuilt
public boolean modelBuilt()flag to indicate whether the model was built yet- Returns:
- true if the model was built
-
setSMOReg
sets the parent SVM- Parameters:
value- the parent SVM
-
getKernelEvaluations
public long getKernelEvaluations()returns the number of kernel evaluations- Returns:
- the number of kernel evaluations
-
getCacheHits
public int getCacheHits()return the number of kernel cache hits- Returns:
- the number of hits
-
buildClassifier
learn SVM parameters from data. Subclasses should implement something more interesting.- Parameters:
data- the data to work with- Throws:
Exception- always an Exceoption since subclasses must override it
-
SVMOutput
- Parameters:
inst-- Returns:
- Throws:
Exception
-
seedTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getSeed
public int getSeed()Gets the current seed value for the random number generator- Returns:
- the seed value
-
setSeed
public void setSeed(int value) Sets the seed value for the random number generator- Parameters:
value- the seed value
-
epsilonParameterTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getEpsilonParameter
public double getEpsilonParameter()Get the value of epsilon parameter of the epsilon insensitive loss function.- Returns:
- Value of epsilon parameter.
-
setEpsilonParameter
public void setEpsilonParameter(double v) Set the value of epsilon parameter of the epsilon insensitive loss function.- Parameters:
v- Value to assign to epsilon parameter.
-
toString
Prints out the classifier. -
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-