gov.sandia.cognition.learning.algorithm.pca
Class PrincipalComponentsAnalysisFunction

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.pca.PrincipalComponentsAnalysisFunction
All Implemented Interfaces:
Evaluator<Vector,Vector>, VectorFunction, CloneableSerializable, Serializable, Cloneable

@CodeReview(reviewer="Kevin R. Dixon",
            date="2008-09-02",
            changesNeeded=false,
            comments={"Added default constructor, minor changes to javadoc and clone() annotation","Looks fine."})
public class PrincipalComponentsAnalysisFunction
extends AbstractCloneableSerializable
implements VectorFunction

This VectorFunction maps a high-dimension input space onto a (hopefully) simple low-dimensional output space by subtracting the mean of the input data, and passing the zero-mean input through a dimension-reducing matrix multiplication function.

Since:
2.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
PrincipalComponentsAnalysisFunction()
          Default constructor
PrincipalComponentsAnalysisFunction(Vector mean, MultivariateDiscriminant dimensionReducer)
          Creates a new instance of PrincipalComponentAnalysisFunction
 
Method Summary
 PrincipalComponentsAnalysisFunction clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 Vector evaluate(Vector input)
          Computes the reduced-dimension representation of the input by subtracting the mean and mapping it through the dimension-reduction matrix multiplication
 MultivariateDiscriminant getDimensionReducer()
          Getter for dimensionReducer
 int getInputDimensionality()
          Returns the expected dimension of input Vectors
 Vector getMean()
          Getter for mean
 int getOutputDimensionality()
          Returns the expected dimension of output Vectors
 void setDimensionReducer(MultivariateDiscriminant dimensionReducer)
          Setter for dimensionReducer
 void setMean(Vector mean)
          Setter for mean
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrincipalComponentsAnalysisFunction

public PrincipalComponentsAnalysisFunction()
Default constructor


PrincipalComponentsAnalysisFunction

public PrincipalComponentsAnalysisFunction(Vector mean,
                                           MultivariateDiscriminant dimensionReducer)
Creates a new instance of PrincipalComponentAnalysisFunction

Parameters:
mean - Sample mean of the data, which is subtracted from input data to yield zero-mean inputs
dimensionReducer - Function that maps a high-dimension input space onto a (hopefully) simple low-dimensional output space capturing the directions of maximum variance (information gain)
Method Detail

clone

public PrincipalComponentsAnalysisFunction clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

evaluate

public Vector evaluate(Vector input)
Computes the reduced-dimension representation of the input by subtracting the mean and mapping it through the dimension-reduction matrix multiplication

Specified by:
evaluate in interface Evaluator<Vector,Vector>
Parameters:
input - Input to reduce the dimensionality
Returns:
Reduced-dimension output representation of the input

getInputDimensionality

public int getInputDimensionality()
Returns the expected dimension of input Vectors

Returns:
Expected dimension of input Vectors

getOutputDimensionality

public int getOutputDimensionality()
Returns the expected dimension of output Vectors

Returns:
Expected dimension of output Vectors

getMean

public Vector getMean()
Getter for mean

Returns:
Sample mean of the data, which is subtracted from input data to yield zero-mean inputs

setMean

public void setMean(Vector mean)
Setter for mean

Parameters:
mean - Sample mean of the data, which is subtracted from input data to yield zero-mean inputs

getDimensionReducer

public MultivariateDiscriminant getDimensionReducer()
Getter for dimensionReducer

Returns:
Function that maps a high-dimension input space onto a (hopefully) simple low-dimensional output space capturing the directions of maximum variance (information gain)

setDimensionReducer

public void setDimensionReducer(MultivariateDiscriminant dimensionReducer)
Setter for dimensionReducer

Parameters:
dimensionReducer - Function that maps a high-dimension input space onto a (hopefully) simple low-dimensional output space capturing the directions of maximum variance (information gain)