Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.varianceanalysis
Class AbstractPCA

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.varianceanalysis.AbstractPCA
All Implemented Interfaces:
Loggable, Parameterizable, PCA
Direct Known Subclasses:
GlobalPCA, LocalPCA

public abstract class AbstractPCA
extends AbstractParameterizable
implements PCA

Abstract super class for pca algorithms. Provides the eigenvalue and eigenvectors.

Author:
Elke Achtert

Field Summary
private  ClassParameter<EigenPairFilter> EIGENPAIR_FILTER_PARAM
          Parameter to specify the filter for determination of the strong and weak eigenvectors, must be a subclass of EigenPairFilter.
private  EigenPairFilter eigenPairFilter
          The eigenpair filter to determine the strong and weak eigenvectors.
private  double[] eigenvalues
          The eigenvalues in decreasing order.
private  Matrix eigenvectors
          The eigenvectors in decreasing order to their corresponding eigenvalues.
private  double[] strongEigenvalues
          The strong eigenvalues.
private  Matrix strongEigenvectors
          The strong eigenvectors to their corresponding filtered eigenvalues.
private  double[] weakEigenvalues
          The weak eigenvalues.
private  Matrix weakEigenvectors
          The weak eigenvectors to their corresponding filtered eigenvalues.
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
protected AbstractPCA()
          Provides an abstract super class for pca algorithms.
 
Method Summary
protected  void determineEigenPairs(Matrix pcaMatrix)
          Determines the (strong and weak) eigenpairs (i.e. the eigenvectors and their corresponding eigenvalues) sorted in descending order of their eigenvalues of the specified matrix.
 List<AttributeSettings> getAttributeSettings()
          Returns the settings of all options assigned to the option handler.
 double[] getEigenvalues()
          Returns a copy of the eigenvalues of the object to which this PCA belongs to in decreasing order.
 Matrix getEigenvectors()
          Returns a copy of the matrix of eigenvectors of the object to which this PCA belongs to.
 double[] getStrongEigenvalues()
          Returns a copy of the strong eigenvalues of the object after passing the eigen pair filter.
 Matrix getStrongEigenvectors()
          Returns a copy of the matrix of strong eigenvectors after passing the eigen pair filter.
 double[] getWeakEigenvalues()
          Returns a copy of the weak eigenvalues of the object after passing the eigen pair filter.
 Matrix getWeakEigenvectors()
          Returns a copy of the matrix of weak eigenvectors after passing the eigen pair filter.
 String[] setParameters(String[] args)
          Sets the attributes of the class accordingly to the given parameters.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, checkGlobalParameterConstraints, deleteOption, description, description, description, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, description, getParameters, getPossibleOptions, inlineDescription
 

Field Detail

EIGENPAIR_FILTER_PARAM

private ClassParameter<EigenPairFilter> EIGENPAIR_FILTER_PARAM
Parameter to specify the filter for determination of the strong and weak eigenvectors, must be a subclass of EigenPairFilter.

Default value: PercentageEigenPairFilter

Key: -pca.filter


eigenPairFilter

private EigenPairFilter eigenPairFilter
The eigenpair filter to determine the strong and weak eigenvectors.


eigenvalues

private double[] eigenvalues
The eigenvalues in decreasing order.


eigenvectors

private Matrix eigenvectors
The eigenvectors in decreasing order to their corresponding eigenvalues.


strongEigenvalues

private double[] strongEigenvalues
The strong eigenvalues.


strongEigenvectors

private Matrix strongEigenvectors
The strong eigenvectors to their corresponding filtered eigenvalues.


weakEigenvalues

private double[] weakEigenvalues
The weak eigenvalues.


weakEigenvectors

private Matrix weakEigenvectors
The weak eigenvectors to their corresponding filtered eigenvalues.

Constructor Detail

AbstractPCA

protected AbstractPCA()
Provides an abstract super class for pca algorithms.

Method Detail

getEigenvectors

public final Matrix getEigenvectors()
Returns a copy of the matrix of eigenvectors of the object to which this PCA belongs to.

Specified by:
getEigenvectors in interface PCA
Returns:
the matrix of eigenvectors

getEigenvalues

public final double[] getEigenvalues()
Returns a copy of the eigenvalues of the object to which this PCA belongs to in decreasing order.

Specified by:
getEigenvalues in interface PCA
Returns:
the eigenvalues

getStrongEigenvectors

public final Matrix getStrongEigenvectors()
Returns a copy of the matrix of strong eigenvectors after passing the eigen pair filter.

Specified by:
getStrongEigenvectors in interface PCA
Returns:
the matrix of eigenvectors

getStrongEigenvalues

public final double[] getStrongEigenvalues()
Returns a copy of the strong eigenvalues of the object after passing the eigen pair filter.

Specified by:
getStrongEigenvalues in interface PCA
Returns:
the eigenvalues

getWeakEigenvectors

public Matrix getWeakEigenvectors()
Returns a copy of the matrix of weak eigenvectors after passing the eigen pair filter.

Specified by:
getWeakEigenvectors in interface PCA
Returns:
the matrix of eigenvectors

getWeakEigenvalues

public double[] getWeakEigenvalues()
Returns a copy of the weak eigenvalues of the object after passing the eigen pair filter.

Specified by:
getWeakEigenvalues in interface PCA
Returns:
the eigenvalues

determineEigenPairs

protected void determineEigenPairs(Matrix pcaMatrix)
Determines the (strong and weak) eigenpairs (i.e. the eigenvectors and their corresponding eigenvalues) sorted in descending order of their eigenvalues of the specified matrix.

Parameters:
pcaMatrix - the matrix used for performing pca

setParameters

public String[] setParameters(String[] args)
                       throws ParameterException
Description copied from interface: Parameterizable
Sets the attributes of the class accordingly to the given parameters. Returns a new String array containing those entries of the given array that are neither expected nor used by this Parameterizable.

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractParameterizable
Parameters:
args - parameters to set the attributes accordingly to
Returns:
String[] an array containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting
See Also:
Parameterizable.setParameters(String[])

getAttributeSettings

public List<AttributeSettings> getAttributeSettings()
Description copied from class: AbstractParameterizable
Returns the settings of all options assigned to the option handler.

Specified by:
getAttributeSettings in interface Parameterizable
Overrides:
getAttributeSettings in class AbstractParameterizable
Returns:
the setting of the attributes of the parameterizable
See Also:
Parameterizable.getAttributeSettings()

Release 0.1 (2008-07-10_1838)