gov.sandia.cognition.learning.data.feature

## Class MultivariateDecorrelator

• ### Constructor Detail

• #### MultivariateDecorrelator

public MultivariateDecorrelator()
Creates a new instance of MultivariateDecorrelator with no underlying Gaussian. It will have to be set later on using setGaussian.
• #### MultivariateDecorrelator

public MultivariateDecorrelator(Vector mean,
Matrix covariance)
Creates a new instance of MultivariateDecorrelator with the given mean and variance.
Parameters:
mean - The mean.
covariance - The variance.
• #### MultivariateDecorrelator

public MultivariateDecorrelator(MultivariateGaussian gaussian)
Creates a new instance of MultivariateDecorrelator with the given multivariate Gaussian.
Parameters:
gaussian - The multivariate Gaussian to use.
• #### MultivariateDecorrelator

public MultivariateDecorrelator(MultivariateDecorrelator other)
Copy constructor.
Parameters:
other - MultivariateDecorrelator to copy
• ### Method Detail

• #### evaluate

public Vector evaluate(Vectorizable value)
Normalizes the given double value by subtracting the mean and dividing by the standard deviation (the square root of the variance).
Specified by:
evaluate in interface Evaluator<Vectorizable,Vector>
Parameters:
value - The value to normalize.
Returns:
The normalized value.
• #### getInputDimensionality

public int getInputDimensionality()
Description copied from interface: VectorInputEvaluator
Gets the expected dimensionality of the input vector to the evaluator, if it is known. If it is not known, -1 is returned.
Specified by:
getInputDimensionality in interface VectorInputEvaluator<Vectorizable,Vector>
Returns:
The expected dimensionality of the input vector to the evaluator, or -1 if it is not known.
• #### getOutputDimensionality

public int getOutputDimensionality()
Description copied from interface: VectorOutputEvaluator
Gets the expected dimensionality of the output vector of the evaluator, if it is known. If it is not known, -1 is returned.
Specified by:
getOutputDimensionality in interface VectorOutputEvaluator<Vectorizable,Vector>
Returns:
The expected dimensionality of the output vector of the evaluator, or -1 if it is not known.
• #### getMean

public Vector getMean()
Gets the mean of the underlying Gaussian.
Returns:
The mean.
• #### getCovariance

public Matrix getCovariance()
Gets the covariance.
Returns:
The covariance
• #### getGaussian

public MultivariateGaussian getGaussian()
Gets the underlying multivariate Gaussian.
Returns:
The underlying multivariate Gaussian.
• #### setGaussian

public void setGaussian(MultivariateGaussian gaussian)
Sets the underlying multivariate Gaussian. A copy of this Gaussian is kept in the object.
Parameters:
gaussian - The Gaussian to use.
• #### getCovarianceInverseSquareRoot

public Matrix getCovarianceInverseSquareRoot()
Gets the square root of the inverse of the covariance matrix. This value is what is used to perform the normalization.
Returns:
The square root of the inverse of the covariance matrix.
• #### learnFullCovariance

public static MultivariateDecorrelator learnFullCovariance(java.util.Collection<? extends Vectorizable> values,
double defaultCovariance)
Learns a normalization based on a mean and full covariance matrix from the given data.
Parameters:
values - The values to learn the decorrelator from.
defaultCovariance - The default value for the covariance. Added to the diagonal of the covariance matrix to prevent singular values.
Returns:
The MultivariateDecorrelator created from the multivariate mean and variance.
• #### learnDiagonalCovariance

public static MultivariateDecorrelator learnDiagonalCovariance(java.util.Collection<? extends Vectorizable> values,
double defaultCovariance)
Learns a normalization based on a mean and covariance where the covariance matrix is diagonal. That is, each dimension is treated separately.
Parameters:
values - The values to use to build the normalizer.
defaultCovariance - The default value for the covariance. Added to the diagonal of the covariance matrix to prevent singular values.
Returns:
The MultivariateDecorrelator created from the multivariate mean and variance of the given values.