de.lmu.ifi.dbs.elki.math.linearalgebra.pca
Class WeightedCovarianceMatrixBuilder<V extends NumberVector<? extends V,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.math.linearalgebra.pca.AbstractCovarianceMatrixBuilder<V>
      extended by de.lmu.ifi.dbs.elki.math.linearalgebra.pca.WeightedCovarianceMatrixBuilder<V>
Type Parameters:
V - Vector class to use
All Implemented Interfaces:
CovarianceMatrixBuilder<V>, InspectionUtilFrequentlyScanned, Parameterizable

@Title(value="Weighted Covariance Matrix / PCA")
@Description(value="A PCA modification by using weights while building the covariance matrix, to obtain more stable results")
@Reference(authors="H.-P. Kriegel, P. Kr\u00f6ger, E. Schubert, A. Zimek",
           title="A General Framework for Increasing the Robustness of PCA-based Correlation Clustering Algorithms",
           booktitle="Proceedings of the 20th International Conference on Scientific and Statistical Database Management (SSDBM), Hong Kong, China, 2008",
           url="http://dx.doi.org/10.1007/978-3-540-69497-7_27")
public class WeightedCovarianceMatrixBuilder<V extends NumberVector<? extends V,?>>
extends AbstractCovarianceMatrixBuilder<V>

CovarianceMatrixBuilder with weights. This builder uses a weight function to weight points differently during build a covariance matrix. Covariance can be canonically extended with weights, as shown in the article A General Framework for Increasing the Robustness of PCA-Based Correlation Clustering Algorithms Hans-Peter Kriegel and Peer Kröger and Erich Schubert and Arthur Zimek In: Proc. 20th Int. Conf. on Scientific and Statistical Database Management (SSDBM), 2008, Hong Kong Lecture Notes in Computer Science 5069, Springer


Nested Class Summary
static class WeightedCovarianceMatrixBuilder.Parameterizer<V extends NumberVector<V,?>>
          Parameterization class.
 
Field Summary
static OptionID WEIGHT_ID
          Parameter to specify the weight function to use in weighted PCA, must implement WeightFunction .
private  PrimitiveDistanceFunction<? super V,DoubleDistance> weightDistance
          Holds the distance function used for weight calculation
protected  WeightFunction weightfunction
          Holds the weight function.
 
Constructor Summary
WeightedCovarianceMatrixBuilder(WeightFunction weightfunction)
          Constructor.
 
Method Summary
 Matrix processIds(DBIDs ids, Relation<? extends V> database)
          Weighted Covariance Matrix for a set of IDs.
<D extends NumberDistance<?,?>>
Matrix
processQueryResults(Collection<DistanceResultPair<D>> results, Relation<? extends V> database, int k)
          Compute Covariance Matrix for a QueryResult Collection By default it will just collect the ids and run processIds
 
Methods inherited from class de.lmu.ifi.dbs.elki.math.linearalgebra.pca.AbstractCovarianceMatrixBuilder
processDatabase, processQueryResults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEIGHT_ID

public static final OptionID WEIGHT_ID
Parameter to specify the weight function to use in weighted PCA, must implement WeightFunction .

Key: -pca.weight


weightfunction

protected WeightFunction weightfunction
Holds the weight function.


weightDistance

private PrimitiveDistanceFunction<? super V extends NumberVector<? extends V,?>,DoubleDistance> weightDistance
Holds the distance function used for weight calculation

Constructor Detail

WeightedCovarianceMatrixBuilder

public WeightedCovarianceMatrixBuilder(WeightFunction weightfunction)
Constructor.

Parameters:
weightfunction -
Method Detail

processIds

public Matrix processIds(DBIDs ids,
                         Relation<? extends V> database)
Weighted Covariance Matrix for a set of IDs. Since we are not supplied any distance information, we'll need to compute it ourselves. Covariance is tied to Euclidean distance, so it probably does not make much sense to add support for other distance functions?

Specified by:
processIds in interface CovarianceMatrixBuilder<V extends NumberVector<? extends V,?>>
Specified by:
processIds in class AbstractCovarianceMatrixBuilder<V extends NumberVector<? extends V,?>>
Parameters:
ids - a collection of ids
database - the database used
Returns:
Covariance Matrix

processQueryResults

public <D extends NumberDistance<?,?>> Matrix processQueryResults(Collection<DistanceResultPair<D>> results,
                                                                  Relation<? extends V> database,
                                                                  int k)
Compute Covariance Matrix for a QueryResult Collection By default it will just collect the ids and run processIds

Specified by:
processQueryResults in interface CovarianceMatrixBuilder<V extends NumberVector<? extends V,?>>
Overrides:
processQueryResults in class AbstractCovarianceMatrixBuilder<V extends NumberVector<? extends V,?>>
Parameters:
results - a collection of QueryResults
database - the database used
k - number of elements to process
Returns:
Covariance Matrix

Release 0.4.0 (2011-09-20_1324)