All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.attributeSelection.ReliefFAttributeEval

java.lang.Object
   |
   +----weka.attributeSelection.ASEvaluation
           |
           +----weka.attributeSelection.AttributeEvaluator
                   |
                   +----weka.attributeSelection.ReliefFAttributeEval

public class ReliefFAttributeEval
extends AttributeEvaluator
implements OptionHandler
Class for Evaluating attributes individually using ReliefF.

For more information see:

Kira, K. and Rendell, L. A. (1992). A practical approach to feature selection. In D. Sleeman and P. Edwards, editors, Proceedings of the International Conference on Machine Learning, pages 249-256. Morgan Kaufmann.

Kononenko, I. (1994). Estimating attributes: analysis and extensions of Relief. In De Raedt, L. and Bergadano, F., editors, Machine Learning: ECML-94, pages 171-182. Springer Verlag.

Marko Robnik Sikonja, Igor Kononenko: An adaptation of Relief for attribute estimation on regression. In D.Fisher (ed.): Machine Learning, Proceedings of 14th International Conference on Machine Learning ICML'97, Nashville, TN, 1997. Valid options are: -M
Specify the number of instances to sample when estimating attributes.
If not specified then all instances will be used.

-D
Seed for randomly sampling instances.

-K
Number of nearest neighbours to use for estimating attributes.
(Default is 10).

-W
Weight nearest neighbours by distance.

-A
Specify sigma value (used in an exp function to control how quickly
weights decrease for more distant instances). Use in conjunction with
-W. Sensible values = 1/5 to 1/10 the number of nearest neighbours.

Version:
$Revision: 1.6 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)

Constructor Index

 o ReliefFAttributeEval()
Constructor

Method Index

 o buildEvaluator(Instances)
Initializes a ReliefF attribute evaluator.
 o evaluateAttribute(int)
Evaluates an individual attribute using ReliefF's instance based approach.
 o getNumNeighbours()
Get the number of nearest neighbours
 o getOptions()
Gets the current settings of ReliefFAttributeEval.
 o getSampleSize()
Get the number of instances used for estimating attributes
 o getSeed()
Get the seed used for randomly sampling instances.
 o getSigma()
Get the value of sigma.
 o getWeightByDistance()
Get whether nearest neighbours are being weighted by distance
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o setNumNeighbours(int)
Set the number of nearest neighbours
 o setOptions(String[])
Parses a given list of options.
 o setSampleSize(int)
Set the number of instances to sample for attribute estimation
 o setSeed(int)
Set the random number seed for randomly sampling instances.
 o setSigma(int)
Sets the sigma value.
 o setWeightByDistance(boolean)
Set the nearest neighbour weighting method
 o toString()
Return a description of the ReliefF attribute evaluator.

Constructors

 o ReliefFAttributeEval
 public ReliefFAttributeEval()
Constructor

Methods

 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options

Returns:
an enumeration of all the available options
 o setOptions
 public void setOptions(String options[]) throws Exception
Parses a given list of options. Valid options are:

-M
Specify the number of instances to sample when estimating attributes.
If not specified then all instances will be used.

-D
Seed for randomly sampling instances.

-K
Number of nearest neighbours to use for estimating attributes.
(Default is 10).

-W
Weight nearest neighbours by distance.

-A
Specify sigma value (used in an exp function to control how quickly
weights decrease for more distant instances). Use in conjunction with
-W. Sensible values = 1/5 to 1/10 the number of nearest neighbours.

Parameters:
options - the list of options as an array of strings
Throws: Exception
if an option is not supported
 o setSigma
 public void setSigma(int s) throws Exception
Sets the sigma value.

Parameters:
s - the value of sigma (> 0)
Throws: Exception
if s is not positive
 o getSigma
 public int getSigma()
Get the value of sigma.

Returns:
the sigma value.
 o setNumNeighbours
 public void setNumNeighbours(int n)
Set the number of nearest neighbours

Parameters:
n - the number of nearest neighbours.
 o getNumNeighbours
 public int getNumNeighbours()
Get the number of nearest neighbours

Returns:
the number of nearest neighbours
 o setSeed
 public void setSeed(int s)
Set the random number seed for randomly sampling instances.

Parameters:
s - the random number seed.
 o getSeed
 public int getSeed()
Get the seed used for randomly sampling instances.

Returns:
the random number seed.
 o setSampleSize
 public void setSampleSize(int s)
Set the number of instances to sample for attribute estimation

Parameters:
s - the number of instances to sample.
 o getSampleSize
 public int getSampleSize()
Get the number of instances used for estimating attributes

Returns:
the number of instances.
 o setWeightByDistance
 public void setWeightByDistance(boolean b)
Set the nearest neighbour weighting method

Parameters:
b - true nearest neighbours are to be weighted by distance.
 o getWeightByDistance
 public boolean getWeightByDistance()
Get whether nearest neighbours are being weighted by distance

Returns:
m_weightByDiffernce
 o getOptions
 public String[] getOptions()
Gets the current settings of ReliefFAttributeEval.

Returns:
an array of strings suitable for passing to setOptions()
 o toString
 public String toString()
Return a description of the ReliefF attribute evaluator.

Returns:
a description of the evaluator as a String.
Overrides:
toString in class Object
 o buildEvaluator
 public void buildEvaluator(Instances data) throws Exception
Initializes a ReliefF attribute evaluator.

Parameters:
data - set of instances serving as training data
Throws: Exception
if the evaluator has not been generated successfully
Overrides:
buildEvaluator in class ASEvaluation
 o evaluateAttribute
 public double evaluateAttribute(int attribute) throws Exception
Evaluates an individual attribute using ReliefF's instance based approach. The actual work is done by buildEvaluator which evaluates all features.

Parameters:
attribute - the index of the attribute to be evaluated
Throws: Exception
if the attribute could not be evaluated
Overrides:
evaluateAttribute in class AttributeEvaluator
 o main
 public static void main(String args[])
Main method for testing this class.

Parameters:
args - the options

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home