public class BDS extends Object implements DataTransform
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.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
|
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() |
Set<Integer> |
getSelectedCategorical()
Returns a copy of the set of categorical features selected by the search
algorithm
|
Set<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.
|
public BDS(BDS toClone)
toClone
- public BDS(int featureCount, Classifier evaluator, int folds)
featureCount
- the number of features to selectdataSet
- the data set to perform feature selection onevaluator
- the classifier to use in determining accuracy given a
feature subsetfolds
- the number of cross validation folds to use in selectionpublic BDS(int featureCount, ClassificationDataSet dataSet, Classifier evaluator, int folds)
featureCount
- the number of features to selectdataSet
- the data set to perform feature selection onevaluator
- the classifier to use in determining accuracy given a
feature subsetfolds
- the number of cross validation folds to use in selectionpublic BDS(int featureCount, Regressor evaluator, int folds)
featureCount
- the number of features to selectevaluator
- the regressor to use in determining accuracy given a
feature subsetfolds
- the number of cross validation folds to use in selectionpublic BDS(int featureCount, RegressionDataSet dataSet, Regressor evaluator, int folds)
featureCount
- the number of features to selectdataSet
- the data set to perform feature selection onevaluator
- the regressor to use in determining accuracy given a
feature subsetfolds
- the number of cross validation folds to use in selectionpublic DataPoint transform(DataPoint dp)
DataTransform
transform
in interface DataTransform
dp
- the data point to apply a transformation topublic BDS clone()
clone
in interface DataTransform
clone
in class Object
public Set<Integer> getSelectedCategorical()
public Set<Integer> getSelectedNumerical()
public void fit(DataSet data)
DataTransform
FailedToFitException
exception may be
thrown.fit
in interface DataTransform
data
- the dataset to fir this transform topublic void setFeatureCount(int featureCount)
featureCount
- the number of features to usepublic int getFeatureCount()
public void setFolds(int folds)
folds
- the number of folds to use for cross validation when estimating the error ratepublic int getFolds()
Copyright © 2017. All rights reserved.