Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.varianceanalysis
Class LocalPCA<V extends RealVector<V,?>>

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
              extended by de.lmu.ifi.dbs.elki.varianceanalysis.LocalPCA<V>
All Implemented Interfaces:
Loggable, Parameterizable, PCA
Direct Known Subclasses:
LinearLocalPCA, LocalKernelPCA

public abstract class LocalPCA<V extends RealVector<V,?>>
extends AbstractPCA

LocalPCA is a super calss for PCA-algorithms considering only a local neighborhood. LocalPCA provides some methods valid for any extending class.

Author:
Elke Achtert

Field Summary
private  Matrix adapatedStrongEigenvectors
          The diagonal matrix of adapted strong eigenvalues: eigenvectors * e_czech.
private  double big
          Holds the big value.
static OptionID BIG_ID
          OptionID for BIG_PARAM
private  DoubleParameter BIG_PARAM
          Parameter to specify a constant big value to reset high eigenvalues, must be a double greater than 0.
private  int correlationDimension
          The correlation dimension (i.e. the number of strong eigenvectors) of the object to which this PCA belongs to.
private  Matrix e_czech
          The selection matrix of the strong eigenvectors.
private  Matrix e_hat
          The selection matrix of the weak eigenvectors.
private  Matrix m_czech
          The dissimilarity matrix.
private  Matrix m_hat
          The similarity matrix.
private  double small
          Holds the small value.
static OptionID SMALL_ID
          OptionID for SMALL_PARAM
private  DoubleParameter SMALL_PARAM
          Parameter to specify a constant small value to reset low eigenvalues, must be a double greater than 0.
 
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
LocalPCA()
          Adds parameter for big and small value to parameter map.
 
Method Summary
 Matrix adapatedStrongEigenvectors()
          Returns a copy of the adapted strong eigenvectors.
 Matrix dissimilarityMatrix()
          Returns a copy of the dissimilarity matrix (M_czech) of this LocalPCA.
 int getCorrelationDimension()
          Returns the correlation dimension (i.e. the number of strong eigenvectors) of the object to which this PCA belongs to.
protected abstract  Matrix pcaMatrix(Database<V> database, Collection<Integer> ids)
          Determines and returns the matrix that is used for performaing the pca.
 void run(Collection<Integer> ids, Database<V> database)
          Performs a LocalPCA for the object with the specified ids stored in the given database.
 Matrix selectionMatrixOfStrongEigenvectors()
          Returns a copy of the selection matrix of the strong eigenvectors (E_czech) of this LocalPCA.
 Matrix selectionMatrixOfWeakEigenvectors()
          Returns a copy of the selection matrix of the weak eigenvectors (E_hat) of the object to which this PCA belongs to.
 String[] setParameters(String[] args)
          Sets the attributes of the class accordingly to the given parameters.
 Matrix similarityMatrix()
          Returns a copy of the similarity matrix (M_hat) of this LocalPCA.
 
Methods inherited from class de.lmu.ifi.dbs.elki.varianceanalysis.AbstractPCA
determineEigenPairs, getAttributeSettings, getEigenvalues, getEigenvectors, getStrongEigenvalues, getStrongEigenvectors, getWeakEigenvalues, getWeakEigenvectors
 
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

BIG_ID

public static final OptionID BIG_ID
OptionID for BIG_PARAM


SMALL_ID

public static final OptionID SMALL_ID
OptionID for SMALL_PARAM


BIG_PARAM

private final DoubleParameter BIG_PARAM
Parameter to specify a constant big value to reset high eigenvalues, must be a double greater than 0.

Default value: 1.0

Key: -localpca.big


SMALL_PARAM

private final DoubleParameter SMALL_PARAM
Parameter to specify a constant small value to reset low eigenvalues, must be a double greater than 0.

Default value: 0.0

Key: -localpca.small


big

private double big
Holds the big value.


small

private double small
Holds the small value.


correlationDimension

private int correlationDimension
The correlation dimension (i.e. the number of strong eigenvectors) of the object to which this PCA belongs to.


e_hat

private Matrix e_hat
The selection matrix of the weak eigenvectors.


e_czech

private Matrix e_czech
The selection matrix of the strong eigenvectors.


m_hat

private Matrix m_hat
The similarity matrix.


m_czech

private Matrix m_czech
The dissimilarity matrix.


adapatedStrongEigenvectors

private Matrix adapatedStrongEigenvectors
The diagonal matrix of adapted strong eigenvalues: eigenvectors * e_czech.

Constructor Detail

LocalPCA

public LocalPCA()
Adds parameter for big and small value to parameter map.

Method Detail

run

public final void run(Collection<Integer> ids,
                      Database<V> database)
Performs a LocalPCA for the object with the specified ids stored in the given database.

Parameters:
ids - the ids of the objects for which the PCA should be performed
database - the database containing the objects

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 AbstractPCA
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[])

getCorrelationDimension

public int getCorrelationDimension()
Returns the correlation dimension (i.e. the number of strong eigenvectors) of the object to which this PCA belongs to.

Returns:
the correlation dimension

selectionMatrixOfWeakEigenvectors

public Matrix selectionMatrixOfWeakEigenvectors()
Returns a copy of the selection matrix of the weak eigenvectors (E_hat) of the object to which this PCA belongs to.

Returns:
the selection matrix of the weak eigenvectors E_hat

selectionMatrixOfStrongEigenvectors

public Matrix selectionMatrixOfStrongEigenvectors()
Returns a copy of the selection matrix of the strong eigenvectors (E_czech) of this LocalPCA.

Returns:
the selection matrix of the weak eigenvectors E_czech

similarityMatrix

public Matrix similarityMatrix()
Returns a copy of the similarity matrix (M_hat) of this LocalPCA.

Returns:
the similarity matrix M_hat

dissimilarityMatrix

public Matrix dissimilarityMatrix()
Returns a copy of the dissimilarity matrix (M_czech) of this LocalPCA.

Returns:
the dissimilarity matrix M_hat

adapatedStrongEigenvectors

public Matrix adapatedStrongEigenvectors()
Returns a copy of the adapted strong eigenvectors.

Returns:
the adapted strong eigenvectors

pcaMatrix

protected abstract Matrix pcaMatrix(Database<V> database,
                                    Collection<Integer> ids)
Determines and returns the matrix that is used for performaing the pca.

Parameters:
database - the database holding the objects
ids - the list of the object ids for which the matrix should be determined
Returns:
he matrix that is used for performaing a pca

Release 0.1 (2008-07-10_1838)