public class RemoveAttributeTransform extends Object implements DataTransform
Modifier and Type | Field and Description |
---|---|
protected int[] |
catIndexMap |
protected int[] |
numIndexMap |
Modifier | Constructor and Description |
---|---|
protected |
RemoveAttributeTransform()
Empty constructor that may be used by extending classes.
|
|
RemoveAttributeTransform(DataSet dataSet,
Set<Integer> categoricalToRemove,
Set<Integer> numericalToRemove)
Creates a new transform for removing specified features from a data set
|
protected |
RemoveAttributeTransform(RemoveAttributeTransform other)
Copy constructor
|
|
RemoveAttributeTransform(Set<Integer> categoricalToRemove,
Set<Integer> numericalToRemove)
Creates a new transform for removing specified features from a data set.
|
Modifier and Type | Method and Description |
---|---|
RemoveAttributeTransform |
clone() |
void |
consolidate(RemoveAttributeTransform preceding)
A serious of Remove Attribute Transforms may be learned and applied
sequentially to a single data set.
|
void |
fit(DataSet data)
Fits this transform to the given dataset.
|
List<Integer> |
getKeptNominal()
Returns an unmodifiable list of the original indices of the nominal
attributes that will be kept when this transform is applied.
|
List<Integer> |
getKeptNumeric()
Returns an unmodifiable list of the original indices of the numeric
attributes that will be kept when this transform is applied.
|
Map<Integer,Integer> |
getReverseNominalMap()
Returns a mapping from the nominal indices in the transformed space back
to their original indices
|
Map<Integer,Integer> |
getReverseNumericMap()
Returns a mapping from the numeric indices in the transformed space back
to their original indices
|
protected void |
setUp(DataSet dataSet,
Set<Integer> categoricalToRemove,
Set<Integer> numericalToRemove)
Sets up the Remove Attribute Transform properly
|
DataPoint |
transform(DataPoint dp)
Returns a new data point that is a transformation of the original data
point.
|
protected RemoveAttributeTransform()
setUp(jsat.DataSet, java.util.Set, java.util.Set)
once the
attributes to remove have been selectedpublic RemoveAttributeTransform(Set<Integer> categoricalToRemove, Set<Integer> numericalToRemove)
fit(jsat.DataSet)
before ready to be used.categoricalToRemove
- the set of categorical attributes to remove,
in the rage of [0, DataSet.getNumCategoricalVars()
).numericalToRemove
- the set of numerical attributes to remove, in
the rage of [0, DataSet.getNumNumericalVars()
).public RemoveAttributeTransform(DataSet dataSet, Set<Integer> categoricalToRemove, Set<Integer> numericalToRemove)
dataSet
- the data set that this transform is meant forcategoricalToRemove
- the set of categorical attributes to remove, in the rage of [0, DataSet.getNumCategoricalVars()
).numericalToRemove
- the set of numerical attributes to remove, in the rage of [0, DataSet.getNumNumericalVars()
).protected RemoveAttributeTransform(RemoveAttributeTransform other)
other
- the transform to copypublic List<Integer> getKeptNumeric()
public Map<Integer,Integer> getReverseNumericMap()
public List<Integer> getKeptNominal()
public Map<Integer,Integer> getReverseNominalMap()
public void fit(DataSet data)
DataTransform
FailedToFitException
exception may be
thrown.fit
in interface DataTransform
data
- the dataset to fir this transform toprotected final void setUp(DataSet dataSet, Set<Integer> categoricalToRemove, Set<Integer> numericalToRemove)
dataSet
- the data set to remove the attributes fromcategoricalToRemove
- the categorical attributes to removenumericalToRemove
- the numeric attributes to removepublic void consolidate(RemoveAttributeTransform preceding)
preceding
- the DataTransform that immediately precedes this one in
a sequential list of transformspublic DataPoint transform(DataPoint dp)
DataTransform
transform
in interface DataTransform
dp
- the data point to apply a transformation topublic RemoveAttributeTransform clone()
clone
in interface DataTransform
clone
in class Object
Copyright © 2017. All rights reserved.