Package weka.attributeSelection
Class SVMAttributeEval
java.lang.Object
weka.attributeSelection.ASEvaluation
weka.attributeSelection.SVMAttributeEval
- All Implemented Interfaces:
Serializable
,AttributeEvaluator
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
public class SVMAttributeEval
extends ASEvaluation
implements AttributeEvaluator, OptionHandler, TechnicalInformationHandler
SVMAttributeEval :
Evaluates the worth of an attribute by using an SVM classifier. Attributes are ranked by the square of the weight assigned by the SVM. Attribute selection for multiclass problems is handled by ranking attributes for each class seperately using a one-vs-all method and then "dealing" from the top of each pile to give a final ranking.
For more information see:
I. Guyon, J. Weston, S. Barnhill, V. Vapnik (2002). Gene selection for cancer classification using support vector machines. Machine Learning. 46:389-422. BibTeX:
Evaluates the worth of an attribute by using an SVM classifier. Attributes are ranked by the square of the weight assigned by the SVM. Attribute selection for multiclass problems is handled by ranking attributes for each class seperately using a one-vs-all method and then "dealing" from the top of each pile to give a final ranking.
For more information see:
I. Guyon, J. Weston, S. Barnhill, V. Vapnik (2002). Gene selection for cancer classification using support vector machines. Machine Learning. 46:389-422. BibTeX:
@article{Guyon2002, author = {I. Guyon and J. Weston and S. Barnhill and V. Vapnik}, journal = {Machine Learning}, pages = {389-422}, title = {Gene selection for cancer classification using support vector machines}, volume = {46}, year = {2002} }Valid options are:
-X <constant rate of elimination> Specify the constant rate of attribute elimination per invocation of the support vector machine. Default = 1.
-Y <percent rate of elimination> Specify the percentage rate of attributes to elimination per invocation of the support vector machine. Trumps constant rate (above threshold). Default = 0.
-Z <threshold for percent elimination> Specify the threshold below which percentage attribute elimination reverts to the constant method.
-P <epsilon> Specify the value of P (epsilon parameter) to pass on to the support vector machine. Default = 1.0e-25
-T <tolerance> Specify the value of T (tolerance parameter) to pass on to the support vector machine. Default = 1.0e-10
-C <complexity> Specify the value of C (complexity parameter) to pass on to the support vector machine. Default = 1.0
-N Whether the SVM should 0=normalize/1=standardize/2=neither. (default 0=normalize)
- Version:
- $Revision: 1.28 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz), Kieran Holland
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a tip text for this property suitable for display in the GUIvoid
buildEvaluator
(Instances data) Initializes the evaluator.Returns a tip text for this property suitable for display in the GUIReturns a tip text for this property suitable for display in the GUIdouble
evaluateAttribute
(int attribute) Evaluates an attribute by returning the rank of the square of its coefficient in a linear support vector machine.Returns a tip text for this property suitable for display in the GUIint
Get the constant rate of attribute elimination per iterationReturns the capabilities of this evaluator.double
Get the value of C used with SMOdouble
Get the value of P used with SMOGet the filtering mode passed to SMOString[]
Gets the current settings of SVMAttributeEvalint
Get the threshold below which percentage elimination reverts to constant elimination.int
Get the percentage rate of attribute elimination per iterationReturns the revision string.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.double
Get the value of T used with SMOReturns a string describing this attribute evaluatorReturns an enumeration describing all the available optionsstatic void
Main method for testing this class.Returns a tip text for this property suitable for display in the GUIReturns a tip text for this property suitable for display in the GUIvoid
setAttsToEliminatePerIteration
(int cRate) Set the constant rate of attribute elimination per iterationvoid
setComplexityParameter
(double svmC) Set the value of C for SMOvoid
setEpsilonParameter
(double svmP) Set the value of P for SMOvoid
setFilterType
(SelectedTag newType) The filtering mode to pass to SMOvoid
setOptions
(String[] options) Parses a given list of options.void
setPercentThreshold
(int pThresh) Set the threshold below which percentage elimination reverts to constant elimination.void
setPercentToEliminatePerIteration
(int pRate) Set the percentage of attributes to eliminate per iterationvoid
setToleranceParameter
(double svmT) Set the value of T for SMOReturns a tip text for this property suitable for display in the GUItoString()
Return a description of the evaluatorMethods inherited from class weka.attributeSelection.ASEvaluation
clean, forName, makeCopies, postProcess
-
Constructor Details
-
SVMAttributeEval
public SVMAttributeEval()Constructor
-
-
Method Details
-
globalInfo
Returns a string describing this attribute evaluator- Returns:
- a description of the evaluator suitable for displaying in the explorer/experimenter gui
-
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.- Specified by:
getTechnicalInformation
in interfaceTechnicalInformationHandler
- Returns:
- the technical information about this class
-
listOptions
Returns an enumeration describing all the available options- Specified by:
listOptions
in interfaceOptionHandler
- Returns:
- an enumeration of options
-
setOptions
Parses a given list of options. Valid options are:-X <constant rate of elimination> Specify the constant rate of attribute elimination per invocation of the support vector machine. Default = 1.
-Y <percent rate of elimination> Specify the percentage rate of attributes to elimination per invocation of the support vector machine. Trumps constant rate (above threshold). Default = 0.
-Z <threshold for percent elimination> Specify the threshold below which percentage attribute elimination reverts to the constant method.
-P <epsilon> Specify the value of P (epsilon parameter) to pass on to the support vector machine. Default = 1.0e-25
-T <tolerance> Specify the value of T (tolerance parameter) to pass on to the support vector machine. Default = 1.0e-10
-C <complexity> Specify the value of C (complexity parameter) to pass on to the support vector machine. Default = 1.0
-N Whether the SVM should 0=normalize/1=standardize/2=neither. (default 0=normalize)
- Specified by:
setOptions
in interfaceOptionHandler
- Parameters:
options
- the list of options as an array of strings- Throws:
Exception
- if an error occurs
-
getOptions
Gets the current settings of SVMAttributeEval- Specified by:
getOptions
in interfaceOptionHandler
- Returns:
- an array of strings suitable for passing to setOptions()
-
attsToEliminatePerIterationTipText
Returns a tip text for this property suitable for display in the GUI- Returns:
- tip text string describing this property
-
percentToEliminatePerIterationTipText
Returns a tip text for this property suitable for display in the GUI- Returns:
- tip text string describing this property
-
percentThresholdTipText
Returns a tip text for this property suitable for display in the GUI- Returns:
- tip text string describing this property
-
epsilonParameterTipText
Returns a tip text for this property suitable for display in the GUI- Returns:
- tip text string describing this property
-
toleranceParameterTipText
Returns a tip text for this property suitable for display in the GUI- Returns:
- tip text string describing this property
-
complexityParameterTipText
Returns a tip text for this property suitable for display in the GUI- Returns:
- tip text string describing this property
-
filterTypeTipText
Returns a tip text for this property suitable for display in the GUI- Returns:
- tip text string describing this property
-
setAttsToEliminatePerIteration
public void setAttsToEliminatePerIteration(int cRate) Set the constant rate of attribute elimination per iteration- Parameters:
cRate
- the constant rate of attribute elimination per iteration
-
getAttsToEliminatePerIteration
public int getAttsToEliminatePerIteration()Get the constant rate of attribute elimination per iteration- Returns:
- the constant rate of attribute elimination per iteration
-
setPercentToEliminatePerIteration
public void setPercentToEliminatePerIteration(int pRate) Set the percentage of attributes to eliminate per iteration- Parameters:
pRate
- percent of attributes to eliminate per iteration
-
getPercentToEliminatePerIteration
public int getPercentToEliminatePerIteration()Get the percentage rate of attribute elimination per iteration- Returns:
- the percentage rate of attribute elimination per iteration
-
setPercentThreshold
public void setPercentThreshold(int pThresh) Set the threshold below which percentage elimination reverts to constant elimination.- Parameters:
pThresh
- percent of attributes to eliminate per iteration
-
getPercentThreshold
public int getPercentThreshold()Get the threshold below which percentage elimination reverts to constant elimination.- Returns:
- the threshold below which percentage elimination stops
-
setEpsilonParameter
public void setEpsilonParameter(double svmP) Set the value of P for SMO- Parameters:
svmP
- the value of P
-
getEpsilonParameter
public double getEpsilonParameter()Get the value of P used with SMO- Returns:
- the value of P
-
setToleranceParameter
public void setToleranceParameter(double svmT) Set the value of T for SMO- Parameters:
svmT
- the value of T
-
getToleranceParameter
public double getToleranceParameter()Get the value of T used with SMO- Returns:
- the value of T
-
setComplexityParameter
public void setComplexityParameter(double svmC) Set the value of C for SMO- Parameters:
svmC
- the value of C
-
getComplexityParameter
public double getComplexityParameter()Get the value of C used with SMO- Returns:
- the value of C
-
setFilterType
The filtering mode to pass to SMO- Parameters:
newType
- the new filtering mode
-
getFilterType
Get the filtering mode passed to SMO- Returns:
- the filtering mode
-
getCapabilities
Returns the capabilities of this evaluator.- Specified by:
getCapabilities
in interfaceCapabilitiesHandler
- Overrides:
getCapabilities
in classASEvaluation
- Returns:
- the capabilities of this evaluator
- See Also:
-
buildEvaluator
Initializes the evaluator.- Specified by:
buildEvaluator
in classASEvaluation
- Parameters:
data
- set of instances serving as training data- Throws:
Exception
- if the evaluator has not been generated successfully
-
evaluateAttribute
Evaluates an attribute by returning the rank of the square of its coefficient in a linear support vector machine.- Specified by:
evaluateAttribute
in interfaceAttributeEvaluator
- Parameters:
attribute
- the index of the attribute to be evaluated- Returns:
- the "merit" of the attribute
- Throws:
Exception
- if the attribute could not be evaluated
-
toString
Return a description of the evaluator -
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classASEvaluation
- Returns:
- the revision
-
main
Main method for testing this class.- Parameters:
args
- the options
-