Documentation of 'jsat.datatransform.featureselection.ReliefF' Java class
ReliefF
jsat.datatransform.featureselection

Class ReliefF

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, DataTransform


    public class ReliefF
    extends RemoveAttributeTransform
    Provides an implementation of the ReliefF algorithm for feature importance computing. Because JSAT does not support neighbor searching for categorical values, it does not provides weights for categorical variables.
    Weight values are in the range [-1, 1]. The value is a measure of corelation, so the absolute value of the individual weights would form its relative importance to the others.
    The ReliefF algorithm is meant for classification problems, and is computed in a nearest neighbor fashion.

    See:
    Kononenko, I., Simec, E.,&Robnik-Sikonja, M. (1997). Overcoming the myopia of inductive learning algorithms with RELIEFF. Applied Intelligence, 7, 39–55.
    See Also:
    Serialized Form
    • Constructor Detail

      • ReliefF

        public ReliefF(int featureCount)
        Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
        Parameters:
        featureCount - the number of features to keep
      • ReliefF

        public ReliefF(int featureCount,
                       int m,
                       int n,
                       DistanceMetric dm)
        Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
        Parameters:
        featureCount - the number of features to keep
        m - the number of learning iterations to perform
        n - the number of neighbors to measure importance from
        dm - the distance metric to use
      • ReliefF

        public ReliefF(ClassificationDataSet cds,
                       int featureCount,
                       int m,
                       int n,
                       DistanceMetric dm)
        Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
        Parameters:
        cds - the data set to measure numeric variable importance from
        featureCount - the number of features to keep
        m - the number of learning iterations to perform
        n - the number of neighbors to measure importance from
        dm - the distance metric to use
      • ReliefF

        public ReliefF(ClassificationDataSet cds,
                       int featureCount,
                       int m,
                       int n,
                       DistanceMetric dm,
                       java.util.concurrent.ExecutorService threadPool)
        Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
        Parameters:
        cds - the data set to measure numeric variable importance from
        featureCount - the number of features to keep
        m - the number of learning iterations to perform
        n - the number of neighbors to measure importance from
        dm - the distance metric to use
        threadPool - the source of threads to use for the computation
      • ReliefF

        public ReliefF(ClassificationDataSet cds,
                       int featureCount,
                       int m,
                       int n,
                       DistanceMetric dm,
                       VectorCollection<Vec> vc)
        Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
        Parameters:
        cds - the data set to measure numeric variable importance from
        featureCount - the number of features to keep
        m - the number of learning iterations to perform
        n - the number of neighbors to measure importance from
        dm - the distance metric to use
        vc - the vector collection to create accelerating structures for nearest neighbor
      • ReliefF

        public ReliefF(int featureCount,
                       int m,
                       int n,
                       DistanceMetric dm,
                       VectorCollection<Vec> vc)
        Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
        Parameters:
        featureCount - the number of features to keep
        m - the number of learning iterations to perform
        n - the number of neighbors to measure importance from
        dm - the distance metric to use
        vc - the factor to create accelerating structures for nearest neighbor
      • ReliefF

        public ReliefF(ClassificationDataSet cds,
                       int featureCount,
                       int m,
                       int n,
                       DistanceMetric dm,
                       VectorCollection<Vec> vcf,
                       java.util.concurrent.ExecutorService threadPool)
        Creates a new ReliefF object to measure the importance of the variables with respect to a classification task. Only numeric features will be removed. Categorical features will be ignored and left in tact by the transformation
        Parameters:
        cds - the data set to measure numeric variable importance from
        featureCount - the number of features to keep
        m - the number of learning iterations to perform
        n - the number of neighbors to measure importance from
        dm - the distance metric to use
        vcf - the factor to create accelerating structures for nearest neighbor
        threadPool - the source of threads to use for the computation
    • Method Detail

      • fit

        public void fit(DataSet data)
        Description copied from interface: DataTransform
        Fits this transform to the given dataset. Some transforms can only be learned from classification or regression datasets. If an incompatible dataset type is given, a FailedToFitException exception may be thrown.
        Specified by:
        fit in interface DataTransform
        Overrides:
        fit in class RemoveAttributeTransform
        Parameters:
        data - the dataset to fir this transform to
      • fit

        public void fit(DataSet data,
                        java.util.concurrent.ExecutorService threadPool)
      • getWeights

        public Vec getWeights()
        Returns accesses to the learned weight data. Altering the values will be reflected in this original ReliefF object.
        Returns:
        access to the raw weight values
      • setFeatureCount

        public void setFeatureCount(int featureCount)
        Sets the number of features to select for use from the set of all input features
        Parameters:
        featureCount - the number of features to use
      • getFeatureCount

        public int getFeatureCount()
        Returns the number of features to sue
        Returns:
        the number of features to sue
      • setIterations

        public void setIterations(int iterations)
        Sets the number of iterations of the ReliefF algorithm that will be run
        Parameters:
        iterations - the number of iterations to run
      • getIterations

        public int getIterations()
        Returns the number of iterations to use
        Returns:
        the number of iterations to use
      • setNeighbors

        public void setNeighbors(int neighbors)
        Sets the number of neighbors to use to infer feature importance from
        Parameters:
        neighbors - the number of neighbors to use
      • getNeighbors

        public int getNeighbors()
        Returns the number of neighbors that will be used at each step of the algorithm.
        Returns:
        the number of neighbors that will be used
      • setDistanceMetric

        public void setDistanceMetric(DistanceMetric dm)
        Sets the distance metric to infer the feature importance with
        Parameters:
        dm - the distance metric to use
      • getDistanceMetric

        public DistanceMetric getDistanceMetric()
        Returns the distance metric to use
        Returns:
        the distance metric to use

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.