jsat.datatransform
Class PolynomialTransform
- java.lang.Object
-
- jsat.datatransform.PolynomialTransform
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, DataTransform
public class PolynomialTransform extends java.lang.Object implements DataTransform
A transform for applying a polynomial transformation on the data set. As the dimension of the data set grows, the number of new features created by a polynomial transform grows rapidly. It is recommended only for small dimension problems using small degrees.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PolynomialTransform(int degree)Creates a new polynomial transform of the given degree
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DataTransformclone()voidfit(DataSet data)Fits this transform to the given dataset.intgetDegree()Returns the polynomial degree to usevoidsetDegree(int degree)Sets the degree of the polynomial to transform the input vector intoDataPointtransform(DataPoint dp)Returns a new data point that is a transformation of the original data point.
-
-
-
Constructor Detail
-
PolynomialTransform
public PolynomialTransform(int degree)
Creates a new polynomial transform of the given degree- Parameters:
degree- the degree of the polynomial- Throws:
java.lang.ArithmeticException- if the degree is not greater than 1
-
-
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 DataTransform clone()
- Specified by:
clonein interfaceDataTransform- Overrides:
clonein classjava.lang.Object
-
setDegree
public void setDegree(int degree)
Sets the degree of the polynomial to transform the input vector into- Parameters:
degree- the positive degree to use
-
getDegree
public int getDegree()
Returns the polynomial degree to use- Returns:
- the polynomial degree to use
-
-
DataMelt 3.0 © DataMelt by jWork.ORG