public class LinearTransform extends Object implements InPlaceInvertibleTransform
Constructor and Description |
---|
LinearTransform()
Creates a new Linear Transformation that will scale
values to the [0, 1] range.
|
LinearTransform(DataSet dataSet)
Creates a new Linear Transformation for the input data set so that all
values are in the [0, 1] range.
|
LinearTransform(DataSet dataSet,
double A,
double B)
Creates a new Linear Transformation for the input data set.
|
LinearTransform(double A,
double B)
Creates a new Linear Transformation.
|
Modifier and Type | Method and Description |
---|---|
LinearTransform |
clone() |
void |
fit(DataSet dataSet)
Fits this transform to the given dataset.
|
DataPoint |
inverse(DataPoint dp)
Applies the inverse or "reverse" transform to approximately undo the
effect of
DataTransform.transform(jsat.classifiers.DataPoint) to recover an
approximation of the original data point. |
void |
mutableInverse(DataPoint dp)
Mutates the given data point.
|
void |
mutableTransform(DataPoint dp)
Mutates the given data point.
|
boolean |
mutatesNominal()
By default returns
false . |
void |
setRange(double A,
double B)
Sets the min and max value to scale the data to.
|
DataPoint |
transform(DataPoint dp)
Returns a new data point that is a transformation of the original data
point.
|
public LinearTransform()
public LinearTransform(DataSet dataSet)
dataSet
- the data set to learn the transform frompublic LinearTransform(double A, double B)
dataSet
- the data set to learn the transform fromA
- the maximum value for the transformed data setB
- the minimum value for the transformed data setpublic LinearTransform(DataSet dataSet, double A, double B)
dataSet
- the data set to learn the transform fromA
- the maximum value for the transformed data setB
- the minimum value for the transformed data setpublic void setRange(double A, double B)
A
- the maximum value for the transformed data setB
- the minimum value for the transformed data setpublic void fit(DataSet dataSet)
DataTransform
FailedToFitException
exception may be
thrown.fit
in interface DataTransform
dataSet
- the dataset to fir this transform topublic DataPoint transform(DataPoint dp)
DataTransform
transform
in interface DataTransform
dp
- the data point to apply a transformation topublic LinearTransform clone()
clone
in interface DataTransform
clone
in interface InPlaceInvertibleTransform
clone
in interface InvertibleTransform
clone
in class Object
public void mutableInverse(DataPoint dp)
InPlaceInvertibleTransform
InvertibleTransform.inverse(jsat.classifiers.DataPoint)
mutableInverse
in interface InPlaceInvertibleTransform
dp
- the data point to alter with an inverse transformationpublic void mutableTransform(DataPoint dp)
InPlaceTransform
DataTransform.transform(jsat.classifiers.DataPoint)
.mutableTransform
in interface InPlaceTransform
dp
- the data point to alterpublic boolean mutatesNominal()
InPlaceTransform
false
. Only returns true if this transform
will mutableTransform the nominal feature values of a data point.mutatesNominal
in interface InPlaceTransform
true
if nominal feature values are mutated, false
otherwise.public DataPoint inverse(DataPoint dp)
InvertibleTransform
DataTransform.transform(jsat.classifiers.DataPoint)
to recover an
approximation of the original data point.inverse
in interface InvertibleTransform
dp
- the transformed data pointCopyright © 2017. All rights reserved.