@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
Constructor and Description |
---|
PrincipalComponentsAnalysisFunction()
Default constructor
|
PrincipalComponentsAnalysisFunction(Vector mean,
MultivariateDiscriminant dimensionReducer)
Creates a new instance of PrincipalComponentAnalysisFunction
|
Modifier and Type | Method and Description |
---|---|
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
|
public PrincipalComponentsAnalysisFunction()
public PrincipalComponentsAnalysisFunction(Vector mean, MultivariateDiscriminant dimensionReducer)
mean
- Sample mean of the data, which is subtracted from input data to yield
zero-mean inputsdimensionReducer
- Function that maps a high-dimension input space onto a (hopefully)
simple low-dimensional output space capturing the directions of
maximum variance (information gain)public PrincipalComponentsAnalysisFunction clone()
AbstractCloneableSerializable
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.clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public Vector evaluate(Vector input)
public int getInputDimensionality()
public int getOutputDimensionality()
public Vector getMean()
public void setMean(Vector mean)
mean
- Sample mean of the data, which is subtracted from input data to yield
zero-mean inputspublic MultivariateDiscriminant getDimensionReducer()
public void setDimensionReducer(MultivariateDiscriminant dimensionReducer)
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)