jsat.datatransform
Class DenseSparceTransform
- java.lang.Object
-
- jsat.datatransform.DenseSparceTransform
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, DataTransform
public class DenseSparceTransform extends java.lang.Object implements DataTransform
Dense sparce transform alters the vectors that store the numerical values. Based on a threshold in (0, 1), vectors will be converted from dense to sparce, sparce to dense, or left alone.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DenseSparceTransform(double factor)Creates a new Dense Sparce Transform.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DenseSparceTransformclone()voidfit(DataSet data)Fits this transform to the given dataset.DataPointtransform(DataPoint dp)Returns a new data point that is a transformation of the original data point.
-
-
-
Constructor Detail
-
DenseSparceTransform
public DenseSparceTransform(double factor)
Creates a new Dense Sparce Transform. The factor gives the maximal percentage of values that may be non zero for a vector to be sparce. Any vector meeting the requirement will be converted to a sparce vector, and others made dense. If the factor is greater than or equal to 1, then all vectors will be made sparce. If less than or equal to 0, then all will be made dense.- Parameters:
factor- the fraction of the vectors values that may be non zero to qualify as sparce
-
-
Method Detail
-
fit
public void fit(DataSet data)
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:
data- the dataset to fir this transform to
-
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 DenseSparceTransform clone()
- Specified by:
clonein interfaceDataTransform- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG