private List < Pair < double [ ] , long [ ] > > findDimensions ( ArrayList < PROCLUSCluster > clusters , Relation < V > database ) { // compute x_ij = avg distance from points in c_i to c_i.centroid final int dim = RelationUtil . dimensionality ( database ) ; final int numc = clusters . size ( ) ; double [ ] [ ] averageDistances = new double [ numc ] [ ] ; for ( int i = 0 ; i < numc ; i ++ ) { PROCLUSCluster c_i = clusters . get ( i ) ; double [ ] x_i = new double [ dim ] ; for ( DBIDIter iter = c_i . objectIDs . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { V o = database . get ( iter ) ; for ( int d = 0 ; d < dim ; d ++ ) { x_i [ d ] += Math . abs ( c_i . centroid [ d ] - o . doubleValue ( d ) ) ; } } for ( int d = 0 ; d < dim ; d ++ ) { x_i [ d ] /= c_i . objectIDs . size ( ) ; } averageDistances [ i ] = x_i ; } List < DoubleIntInt > z_ijs = computeZijs ( averageDistances , dim ) ; long [ ] [ ] dimensionMap = computeDimensionMap ( z_ijs , dim , numc ) ; // mapping cluster -> dimensions List < Pair < double [ ] , long [ ] > > result = new ArrayList <> ( numc ) ; for ( int i = 0 ; i < numc ; i ++ ) { long [ ] dims_i = dimensionMap [ i ] ; if ( dims_i == null ) { continue ; } result . add ( new Pair <> ( clusters . get ( i ) . centroid , dims_i ) ) ; } return result ; }
Refinement step that determines the set of correlated dimensions for each cluster centroid .