private ProjectedEnergy projectedEnergy ( Relation < V > relation , ORCLUSCluster c_i , ORCLUSCluster c_j , int i , int j , int dim ) { NumberVectorDistanceFunction < ? super V > distFunc = SquaredEuclideanDistanceFunction . STATIC ; // union of cluster c_i and c_j ORCLUSCluster c_ij = union ( relation , c_i , c_j , dim ) ; double sum = 0. ; NumberVector c_proj = DoubleVector . wrap ( project ( c_ij , c_ij . centroid ) ) ; for ( DBIDIter iter = c_ij . objectIDs . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { NumberVector o_proj = DoubleVector . wrap ( project ( c_ij , relation . get ( iter ) . toArray ( ) ) ) ; sum += distFunc . distance ( o_proj , c_proj ) ; } sum /= c_ij . objectIDs . size ( ) ; return new ProjectedEnergy ( i , j , c_ij , sum ) ; }
Computes the projected energy of the specified clusters . The projected energy is given by the mean square distance of the points to the centroid of the union cluster c when all points in c are projected to the subspace of c .