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

Class SFS

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


    public class SFS
    extends java.lang.Object
    implements DataTransform
    Sequential Forward Selection (SFS) is a greedy method of selecting a subset of features to use for prediction. It starts from the set of no features and attempts to add the next best feature to the set at each iteration.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      SFS(int minFeatures, int maxFeatures, ClassificationDataSet dataSet, Classifier evaluater, int folds, double maxIncrease)
      Performs SFS feature selection for a classification problem
      SFS(int minFeatures, int maxFeatures, Classifier evaluater, double maxIncrease)
      Performs SFS feature selection for a classification problem
      SFS(int minFeatures, int maxFeatures, RegressionDataSet dataSet, Regressor regressor, int folds, double maxIncrease)
      Performs SFS feature selection for a regression problem
      SFS(int minFeatures, int maxFeatures, Regressor regressor, double maxIncrease)
      Creates SFS feature selection for a regression problem
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      SFS clone() 
      void fit(DataSet data)
      Fits this transform to the given dataset.
      int getFolds() 
      int getMaxFeatures()
      Returns the maximum number of features to find
      double getMaxIncrease() 
      int getMinFeatures()
      Returns the minimum number of features to find
      java.util.Set<java.lang.Integer> getSelectedCategorical()
      Returns a copy of the set of categorical features selected by the search algorithm
      java.util.Set<java.lang.Integer> getSelectedNumerical()
      Returns a copy of the set of numerical features selected by the search algorithm.
      void setFolds(int folds)
      Sets the number of folds to use for cross validation when estimating the error rate
      void setMaxFeatures(int maxFeatures)
      Sets the maximum number of features that must be selected
      void setMaxIncrease(double maxIncrease)
      Sets the maximum allowable the maximum tolerable increase in error when a feature is added
      void setMinFeatures(int minFeatures)
      Sets the minimum number of features that must be selected
      DataPoint transform(DataPoint dp)
      Returns a new data point that is a transformation of the original data point.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SFS

        public SFS(int minFeatures,
                   int maxFeatures,
                   Classifier evaluater,
                   double maxIncrease)
        Performs SFS feature selection for a classification problem
        Parameters:
        minFeatures - the minimum number of features to find
        maxFeatures - the maximum number of features to find
        evaluater - the classifier to use in determining accuracy given a feature subset
        maxIncrease - the maximum tolerable increase in error when a feature is added
      • SFS

        public SFS(int minFeatures,
                   int maxFeatures,
                   ClassificationDataSet dataSet,
                   Classifier evaluater,
                   int folds,
                   double maxIncrease)
        Performs SFS feature selection for a classification problem
        Parameters:
        minFeatures - the minimum number of features to find
        maxFeatures - the maximum number of features to find
        dataSet - the data set to perform feature selection on
        evaluater - the classifier to use in determining accuracy given a feature subset
        folds - the number of cross validation folds to use in selection
        maxIncrease - the maximum tolerable increase in error when a feature is added
      • SFS

        public SFS(int minFeatures,
                   int maxFeatures,
                   Regressor regressor,
                   double maxIncrease)
        Creates SFS feature selection for a regression problem
        Parameters:
        minFeatures - the minimum number of features to find
        maxFeatures - the maximum number of features to find
        regressor - the regressor to use in determining accuracy given a feature subset
        maxIncrease - the maximum tolerable increase in error when a feature is added
      • SFS

        public SFS(int minFeatures,
                   int maxFeatures,
                   RegressionDataSet dataSet,
                   Regressor regressor,
                   int folds,
                   double maxIncrease)
        Performs SFS feature selection for a regression problem
        Parameters:
        minFeatures - the minimum number of features to find
        maxFeatures - the maximum number of features to find
        dataSet - the data set to perform feature selection on
        regressor - the regressor to use in determining accuracy given a feature subset
        folds - the number of cross validation folds to use in selection
        maxIncrease - the maximum tolerable increase in error when a feature is added
    • 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
        Parameters:
        data - the dataset to fir this transform to
      • transform

        public DataPoint transform(DataPoint dp)
        Description copied from interface: DataTransform
        Returns a new data point that is a transformation of the original data point. This new data point is a different object, but may contain the same references as the original data point. It is not guaranteed that you can mutate the transformed point without having a side effect on the original point.
        Specified by:
        transform in interface DataTransform
        Parameters:
        dp - the data point to apply a transformation to
        Returns:
        a transformed data point
      • clone

        public SFS clone()
        Specified by:
        clone in interface DataTransform
        Overrides:
        clone in class java.lang.Object
      • getSelectedCategorical

        public java.util.Set<java.lang.Integer> getSelectedCategorical()
        Returns a copy of the set of categorical features selected by the search algorithm
        Returns:
        the set of categorical features to use
      • getSelectedNumerical

        public java.util.Set<java.lang.Integer> getSelectedNumerical()
        Returns a copy of the set of numerical features selected by the search algorithm.
        Returns:
        the set of numeric features to use
      • setMaxIncrease

        public void setMaxIncrease(double maxIncrease)
        Sets the maximum allowable the maximum tolerable increase in error when a feature is added
        Parameters:
        maxIncrease - the maximum allowable the maximum tolerable increase in error when a feature is added
      • getMaxIncrease

        public double getMaxIncrease()
        Returns:
        the maximum allowable the maximum tolerable increase in error when a feature is added
      • setMinFeatures

        public void setMinFeatures(int minFeatures)
        Sets the minimum number of features that must be selected
        Parameters:
        minFeatures - the minimum number of features to learn
      • getMinFeatures

        public int getMinFeatures()
        Returns the minimum number of features to find
        Returns:
        the minimum number of features to find
      • setMaxFeatures

        public void setMaxFeatures(int maxFeatures)
        Sets the maximum number of features that must be selected
        Parameters:
        maxFeatures - the maximum number of features to find
      • getMaxFeatures

        public int getMaxFeatures()
        Returns the maximum number of features to find
        Returns:
        the maximum number of features to find
      • setFolds

        public void setFolds(int folds)
        Sets the number of folds to use for cross validation when estimating the error rate
        Parameters:
        folds - the number of folds to use for cross validation when estimating the error rate
      • getFolds

        public int getFolds()
        Returns:
        the number of folds to use for cross validation when estimating the error rate

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.