
V - Vector class to use@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 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| Modifier and Type | Class and Description | 
|---|---|
| static class  | WeightedCovarianceMatrixBuilder.Parameterizer<V extends NumberVector<?>>Parameterization class. | 
| Modifier and Type | Field and Description | 
|---|---|
| static OptionID | WEIGHT_IDParameter to specify the weight function to use in weighted PCA, must
 implement
  WeightFunction. | 
| private PrimitiveDistanceFunction<? super V,DoubleDistance> | weightDistanceHolds the distance function used for weight calculation. | 
| protected WeightFunction | weightfunctionHolds the weight function. | 
| Constructor and Description | 
|---|
| WeightedCovarianceMatrixBuilder(WeightFunction weightfunction)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| Matrix | processIds(DBIDs ids,
          Relation<? extends V> relation)Weighted Covariance Matrix for a set of IDs. | 
| <D extends NumberDistance<D,?>>  | processQueryResults(DistanceDBIDResult<D> results,
                   Relation<? extends V> database,
                   int k)Compute Covariance Matrix for a QueryResult Collection. | 
processDatabase, processQueryResultspublic static final OptionID WEIGHT_ID
WeightFunction
 .
 
 Key: -pca.weight
 
protected WeightFunction weightfunction
private PrimitiveDistanceFunction<? super V extends NumberVector<?>,DoubleDistance> weightDistance
public WeightedCovarianceMatrixBuilder(WeightFunction weightfunction)
weightfunction - Weighting functionpublic Matrix processIds(DBIDs ids, Relation<? extends V> relation)
processIds in interface CovarianceMatrixBuilder<V extends NumberVector<?>>processIds in class AbstractCovarianceMatrixBuilder<V extends NumberVector<?>>ids - Database ids to processrelation - Relation to processpublic <D extends NumberDistance<D,?>> Matrix processQueryResults(DistanceDBIDResult<D> results, Relation<? extends V> database, int k)
processQueryResults in interface CovarianceMatrixBuilder<V extends NumberVector<?>>processQueryResults in class AbstractCovarianceMatrixBuilder<V extends NumberVector<?>>D - distance typeresults - a collection of QueryResultsdatabase - the database usedk - number of elements to process