jsat.datatransform
Class Imputer
- java.lang.Object
-
- jsat.datatransform.Imputer
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, DataTransform, InPlaceTransform
public class Imputer extends java.lang.Object implements InPlaceTransform
Imputes missing values in a dataset by finding reasonable default values. For categorical features, the mode will always be used for imputing. Numeric values can change how the imputing value is selected by using theImputer.NumericImputionModeenum.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classImputer.NumericImputionMode
-
Constructor Summary
Constructors Constructor and Description Imputer(DataSet<?> data)Imputer(DataSet<?> data, Imputer.NumericImputionMode mode)Imputer(Imputer toCopy)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Imputerclone()voidfit(DataSet d)Fits this transform to the given dataset.voidmutableTransform(DataPoint dp)Mutates the given data point.booleanmutatesNominal()By default returnsfalse.DataPointtransform(DataPoint dp)Returns a new data point that is a transformation of the original data point.
-
-
-
Constructor Detail
-
Imputer
public Imputer(DataSet<?> data)
-
Imputer
public Imputer(DataSet<?> data, Imputer.NumericImputionMode mode)
-
Imputer
public Imputer(Imputer toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
fit
public void fit(DataSet d)
Description copied from interface:DataTransformFits this transform to the given dataset. Some transforms can only be learned from classification or regression datasets. If an incompatible dataset type is given, aFailedToFitExceptionexception may be thrown.- Specified by:
fitin interfaceDataTransform- Parameters:
d- the dataset to fir this transform to
-
mutableTransform
public void mutableTransform(DataPoint dp)
Description copied from interface:InPlaceTransformMutates the given data point. This causes side effects, altering the data point to have the same value as the output ofDataTransform.transform(jsat.classifiers.DataPoint).- Specified by:
mutableTransformin interfaceInPlaceTransform- Parameters:
dp- the data point to alter
-
mutatesNominal
public boolean mutatesNominal()
Description copied from interface:InPlaceTransformBy default returnsfalse. Only returns true if this transform will mutableTransform the nominal feature values of a data point.- Specified by:
mutatesNominalin interfaceInPlaceTransform- Returns:
trueif nominal feature values are mutated,falseotherwise.
-
transform
public DataPoint transform(DataPoint dp)
Description copied from interface:DataTransformReturns 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:
transformin interfaceDataTransform- Parameters:
dp- the data point to apply a transformation to- Returns:
- a transformed data point
-
clone
public Imputer clone()
- Specified by:
clonein interfaceDataTransform- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG