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

Class BDS

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


    public class BDS
    extends java.lang.Object
    implements DataTransform
    Bidirectional Search (BDS) is a greedy method of selecting a subset of features to use for prediction. It performs both SFS and SBS search at the same time. At each step, a feature is greedily added to one set, and then a feature greedily removed from another set. Once a feature is added / removed in one set, it is unavailable for selection in the other. This can be used to select up to half of the original features.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      BDS(BDS toClone)
      Copy constructor
      BDS(int featureCount, ClassificationDataSet dataSet, Classifier evaluator, int folds)
      Performs BDS feature selection for a classification problem
      BDS(int featureCount, Classifier evaluator, int folds)
      Creates a BDS feature selection for a classification problem
      BDS(int featureCount, RegressionDataSet dataSet, Regressor evaluator, int folds)
      Performs BDS feature selection for a regression problem
      BDS(int featureCount, Regressor evaluator, int folds)
      Creates a BDS feature selection for a regression problem
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      BDS clone() 
      void fit(DataSet data)
      Fits this transform to the given dataset.
      int getFeatureCount()
      Returns the number of features to use
      int getFolds() 
      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 setFeatureCount(int featureCount)
      Sets the number of features to select for use from the set of all input features
      void setFolds(int folds)
      Sets the number of folds to use for cross validation when estimating the error rate
      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

      • BDS

        public BDS(BDS toClone)
        Copy constructor
        Parameters:
        toClone -
      • BDS

        public BDS(int featureCount,
                   Classifier evaluator,
                   int folds)
        Creates a BDS feature selection for a classification problem
        Parameters:
        featureCount - the number of features to select
        dataSet - the data set to perform feature selection on
        evaluator - the classifier to use in determining accuracy given a feature subset
        folds - the number of cross validation folds to use in selection
      • BDS

        public BDS(int featureCount,
                   ClassificationDataSet dataSet,
                   Classifier evaluator,
                   int folds)
        Performs BDS feature selection for a classification problem
        Parameters:
        featureCount - the number of features to select
        dataSet - the data set to perform feature selection on
        evaluator - the classifier to use in determining accuracy given a feature subset
        folds - the number of cross validation folds to use in selection
      • BDS

        public BDS(int featureCount,
                   Regressor evaluator,
                   int folds)
        Creates a BDS feature selection for a regression problem
        Parameters:
        featureCount - the number of features to select
        evaluator - the regressor to use in determining accuracy given a feature subset
        folds - the number of cross validation folds to use in selection
      • BDS

        public BDS(int featureCount,
                   RegressionDataSet dataSet,
                   Regressor evaluator,
                   int folds)
        Performs BDS feature selection for a regression problem
        Parameters:
        featureCount - the number of features to select
        dataSet - the data set to perform feature selection on
        evaluator - the regressor to use in determining accuracy given a feature subset
        folds - the number of cross validation folds to use in selection
    • Method Detail

      • 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 BDS 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
      • 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
      • 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 use
        Returns:
        the number of features to use
      • 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.