public class WhitenedPCA extends DataTransformBase
PCA
that attempts to capture the variance, and make
the variables in the output space independent from each-other. An of equal
scale, so that the covariance is equal to I
. The
results may be further from the identity matrix than desired as the target
dimension shrinksModifier and Type | Field and Description |
---|---|
protected int |
dimensions
The number of dimensions to project down to
|
protected double |
regularization
Regularization parameter
|
protected Matrix |
transform
The final transformation matrix, that will create new points
y = transform * x
|
Constructor and Description |
---|
WhitenedPCA()
Creates a new WhitenedPCA transform that uses up to 50 dimensions for the
transformed space.
|
WhitenedPCA(DataSet dataSet)
Creates a new WhitenedPCA.
|
WhitenedPCA(DataSet dataSet,
double regularization)
Creates a new WhitenedPCA, the dimensions will be chosen so that the
subset of dimensions is of full rank.
|
WhitenedPCA(DataSet dataSet,
double regularization,
int dims)
Creates a new WhitenedPCA from the given dataset
|
WhitenedPCA(DataSet dataSet,
int dims)
Creates a new WhitenedPCA.
|
WhitenedPCA(double regularization,
int dims)
Creates a new WhitenedPCA transform
|
WhitenedPCA(int dims)
Creates a new WhitenedPCA transform
|
Modifier and Type | Method and Description |
---|---|
DataTransform |
clone() |
void |
fit(DataSet dataSet)
Fits this transform to the given dataset.
|
int |
getDimensions()
Returns the number of dimensions to project down to
|
double |
getRegularization() |
static Distribution |
guessDimensions(DataSet d) |
void |
setDimensions(int dimensions)
Sets the number of dimensions to project down to
|
void |
setRegularization(double regularization) |
protected void |
setUpTransform(SingularValueDecomposition svd)
Creates the
transform matrix to be used when
converting data points. |
DataPoint |
transform(DataPoint dp)
Returns a new data point that is a transformation of the original data
point.
|
getParameter, getParameters
protected double regularization
protected int dimensions
protected Matrix transform
public WhitenedPCA()
dims
- the number of dimensions to project down topublic WhitenedPCA(int dims)
dims
- the number of dimensions to project down topublic WhitenedPCA(double regularization, int dims)
regularization
- the amount of regularization to add, avoids
numerical instabilitydims
- the number of dimensions to project down topublic WhitenedPCA(DataSet dataSet, double regularization, int dims)
dataSet
- the data set to whitenregularization
- the amount of regularization to add, avoids numerical instabilitydims
- the number of dimensions to project down topublic WhitenedPCA(DataSet dataSet, double regularization)
dataSet
- the data set to whitenregularization
- the amount of regularization to add, avoids numerical instabilitypublic WhitenedPCA(DataSet dataSet)
dataSet
- the data set to whitenpublic WhitenedPCA(DataSet dataSet, int dims)
dataSet
- the data set to whitendims
- the number of dimensions to project down topublic void fit(DataSet dataSet)
DataTransform
FailedToFitException
exception may be
thrown.dataSet
- the dataset to fir this transform toprotected void setUpTransform(SingularValueDecomposition svd)
transform matrix
to be used when
converting data points. It is called in the constructor after all values
are set.svd
- the SVD of the covariance of the source data setpublic DataPoint transform(DataPoint dp)
DataTransform
dp
- the data point to apply a transformation topublic void setRegularization(double regularization)
regularization
- the regularization to apply to the diagonal of the
decomposition. This can improve numeric stability and reduces noise.public double getRegularization()
public DataTransform clone()
clone
in interface DataTransform
clone
in class DataTransformBase
public void setDimensions(int dimensions)
dimensions
- the feature size to project down topublic int getDimensions()
public static Distribution guessDimensions(DataSet d)
Copyright © 2017. All rights reserved.