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
|
String[] |
getOptions()
Gets the current settings of ReliefFAttributeEval.
|
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
|
String |
globalInfo()
Returns a string describing this attribute evaluator
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for testing this class.
|
String |
numNeighboursTipText()
Returns the tip text for this property
|
String |
sampleSizeTipText()
Returns the tip text for this property
|
String |
seedTipText()
Returns the tip text for this property
|
void |
setNumNeighbours(int n)
Set the number of nearest neighbours
|
void |
setOptions(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
|
String |
sigmaTipText()
Returns the tip text for this property
|
String |
toString()
Return a description of the ReliefF attribute evaluator.
|
String |
weightByDistanceTipText()
Returns the tip text for this property
|
forName, makeCopies, postProcess, runEvaluator
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws 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
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String sigmaTipText()
public void setSigma(int s) throws Exception
s
- the value of sigma (> 0)Exception
- if s is not positivepublic int getSigma()
public String numNeighboursTipText()
public void setNumNeighbours(int n)
n
- the number of nearest neighbours.public int getNumNeighbours()
public String seedTipText()
public void setSeed(int s)
s
- the random number seed.public int getSeed()
public String sampleSizeTipText()
public void setSampleSize(int s)
s
- the number of instances to sample.public int getSampleSize()
public String weightByDistanceTipText()
public void setWeightByDistance(boolean b)
b
- true nearest neighbours are to be weighted by distance.public boolean getWeightByDistance()
public String[] getOptions()
getOptions
in interface OptionHandler
public String toString()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class ASEvaluation
Capabilities
public void buildEvaluator(Instances data) throws Exception
buildEvaluator
in class ASEvaluation
data
- set of instances serving as training dataException
- if the evaluator has not been
generated successfullypublic double evaluateAttribute(int attribute) throws Exception
evaluateAttribute
in interface AttributeEvaluator
attribute
- the index of the attribute to be evaluatedException
- if the attribute could not be evaluatedpublic String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ASEvaluation
public static void main(String[] args)
args
- the optionsCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.