public class ReliefFAttributeEval extends ASEvaluation implements AttributeEvaluator, OptionHandler, TechnicalInformationHandler
@inproceedings{Kira1992, author = {Kenji Kira and Larry A. Rendell}, booktitle = {Ninth International Workshop on Machine Learning}, editor = {Derek H. Sleeman and Peter Edwards}, pages = {249-256}, publisher = {Morgan Kaufmann}, title = {A Practical Approach to Feature Selection}, year = {1992} } @inproceedings{Kononenko1994, author = {Igor Kononenko}, booktitle = {European Conference on Machine Learning}, editor = {Francesco Bergadano and Luc De Raedt}, pages = {171-182}, publisher = {Springer}, title = {Estimating Attributes: Analysis and Extensions of RELIEF}, year = {1994} } @inproceedings{Robnik-Sikonja1997, author = {Marko Robnik-Sikonja and Igor Kononenko}, booktitle = {Fourteenth International Conference on Machine Learning}, editor = {Douglas H. Fisher}, pages = {296-304}, publisher = {Morgan Kaufmann}, title = {An adaptation of Relief for attribute estimation in regression}, year = {1997} }Valid options are:
-M <num instances> Specify the number of instances to sample when estimating attributes. If not specified, then all instances will be used.
-D <seed> Seed for randomly sampling instances. (Default = 1)
-K <number of neighbours> Number of nearest neighbours (k) used to estimate attribute relevances (Default = 10).
-W Weight nearest neighbours by distance
-A <num> Specify sigma value (used in an exp function to control how quickly weights for more distant instances decrease. Use in conjunction with -W. Sensible value=1/5 to 1/10 of the number of nearest neighbours. (Default = 2)
Constructor and Description |
---|
ReliefFAttributeEval()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
buildEvaluator(Instances data)
Initializes a ReliefF attribute evaluator.
|
double |
evaluateAttribute(int attribute)
Evaluates an individual attribute using ReliefF's instance based approach.
|
Capabilities |
getCapabilities()
Returns the capabilities of this evaluator.
|
int |
getNumNeighbours()
Get the number of nearest neighbours
|
java.lang.String[] |
getOptions()
Gets the current settings of ReliefFAttributeEval.
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
getSampleSize()
Get the number of instances used for estimating attributes
|
int |
getSeed()
Get the seed used for randomly sampling instances.
|
int |
getSigma()
Get the value of sigma.
|
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.
|
boolean |
getWeightByDistance()
Get whether nearest neighbours are being weighted by distance
|
java.lang.String |
globalInfo()
Returns a string describing this attribute evaluator
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
java.lang.String |
numNeighboursTipText()
Returns the tip text for this property
|
int[] |
postProcess(int[] attributeSet)
Provides a chance for a attribute evaluator to do any special post
processing of the selected attribute set.
|
java.lang.String |
sampleSizeTipText()
Returns the tip text for this property
|
java.lang.String |
seedTipText()
Returns the tip text for this property
|
void |
setNumNeighbours(int n)
Set the number of nearest neighbours
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSampleSize(int s)
Set the number of instances to sample for attribute estimation
|
void |
setSeed(int s)
Set the random number seed for randomly sampling instances.
|
void |
setSigma(int s)
Sets the sigma value.
|
void |
setWeightByDistance(boolean b)
Set the nearest neighbour weighting method
|
java.lang.String |
sigmaTipText()
Returns the tip text for this property
|
java.lang.String |
toString()
Return a description of the ReliefF attribute evaluator.
|
java.lang.String |
weightByDistanceTipText()
Returns the tip text for this property
|
clean, doNotCheckCapabilitiesTipText, forName, getDoNotCheckCapabilities, makeCopies, postExecution, preExecution, run, runEvaluator, setDoNotCheckCapabilities
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class ASEvaluation
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-M <num instances> Specify the number of instances to sample when estimating attributes. If not specified, then all instances will be used.
-D <seed> Seed for randomly sampling instances. (Default = 1)
-K <number of neighbours> Number of nearest neighbours (k) used to estimate attribute relevances (Default = 10).
-W Weight nearest neighbours by distance
-A <num> Specify sigma value (used in an exp function to control how quickly weights for more distant instances decrease. Use in conjunction with -W. Sensible value=1/5 to 1/10 of the number of nearest neighbours. (Default = 2)
setOptions
in interface OptionHandler
setOptions
in class ASEvaluation
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String sigmaTipText()
public void setSigma(int s) throws java.lang.Exception
s
- the value of sigma (> 0)java.lang.Exception
- if s is not positivepublic int getSigma()
public java.lang.String numNeighboursTipText()
public void setNumNeighbours(int n)
n
- the number of nearest neighbours.public int getNumNeighbours()
public java.lang.String seedTipText()
public void setSeed(int s)
s
- the random number seed.public int getSeed()
public java.lang.String sampleSizeTipText()
public void setSampleSize(int s)
s
- the number of instances to sample.public int getSampleSize()
public java.lang.String weightByDistanceTipText()
public void setWeightByDistance(boolean b)
b
- true nearest neighbours are to be weighted by distance.public boolean getWeightByDistance()
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class ASEvaluation
public java.lang.String toString()
toString
in class java.lang.Object
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class ASEvaluation
Capabilities
public void buildEvaluator(Instances data) throws java.lang.Exception
buildEvaluator
in class ASEvaluation
data
- set of instances serving as training datajava.lang.Exception
- if the evaluator has not been generated successfullypublic double evaluateAttribute(int attribute) throws java.lang.Exception
evaluateAttribute
in interface AttributeEvaluator
attribute
- the index of the attribute to be evaluatedjava.lang.Exception
- if the attribute could not be evaluatedpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ASEvaluation
public int[] postProcess(int[] attributeSet)
ASEvaluation
postProcess
in class ASEvaluation
attributeSet
- the set of attributes found by the searchpublic static void main(java.lang.String[] args)
args
- the options