public class JLTransform extends DataTransformBase
Euclidean distances
between points
approximately the same in the original and projected space. Modifier and Type | Class and Description |
---|---|
static class |
JLTransform.TransformMode
Determines which distribution to construct the transform matrix from
|
Modifier | Constructor and Description |
---|---|
|
JLTransform()
Creates a new JL Transform that uses a target dimension of 50 features.
|
|
JLTransform(int k)
Creates a new JL Transform
|
|
JLTransform(int k,
JLTransform.TransformMode mode)
Creates a new JL Transform
|
|
JLTransform(int k,
JLTransform.TransformMode mode,
boolean inMemory)
Creates a new JL Transform
|
protected |
JLTransform(JLTransform transform)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
DataTransform |
clone() |
void |
fit(DataSet data)
Fits this transform to the given dataset.
|
JLTransform.TransformMode |
getMode() |
int |
getProjectedDimension() |
static Distribution |
guessProjectedDimension(DataSet d) |
boolean |
isInMemory() |
void |
setInMemory(boolean inMemory)
Sets whether or not the transform matrix is stored explicitly in memory
or not.
|
void |
setMode(JLTransform.TransformMode mode)
The JL transform uses a random matrix to project the data, and the mode
controls which method is used to construct this matrix.
|
void |
setProjectedDimension(int k)
Sets the target dimension size to use for the output
|
DataPoint |
transform(DataPoint dp)
Returns a new data point that is a transformation of the original data
point.
|
getParameter, getParameters
protected JLTransform(JLTransform transform)
transform
- the transform to copypublic JLTransform()
k
- the target dimension sizepublic JLTransform(int k)
k
- the target dimension sizepublic JLTransform(int k, JLTransform.TransformMode mode)
k
- the target dimension sizemode
- how to construct the transformrand
- the source of randomnesspublic JLTransform(int k, JLTransform.TransformMode mode, boolean inMemory)
k
- the target dimension sizemode
- how to construct the transforminMemory
- if false
, the matrix will be stored in O(1)
memory at the cost of execution time.public void fit(DataSet data)
DataTransform
FailedToFitException
exception may be
thrown.data
- the dataset to fir this transform topublic void setMode(JLTransform.TransformMode mode)
mode
- how to construct the transformpublic JLTransform.TransformMode getMode()
public void setInMemory(boolean inMemory)
inMemory
- true
to explicitly store the transform matrix,
false
to re-create it on the fly as neededpublic boolean isInMemory()
true
if this object will explicitly store the transform
matrix, false
to re-create it on the fly as neededpublic void setProjectedDimension(int k)
k
- the dimension after apply the transformpublic int getProjectedDimension()
public static Distribution guessProjectedDimension(DataSet d)
public DataPoint transform(DataPoint dp)
DataTransform
dp
- the data point to apply a transformation topublic DataTransform clone()
clone
in interface DataTransform
clone
in class DataTransformBase
Copyright © 2017. All rights reserved.