private int getClusterBoundary ( Relation < O > relation , List < ? extends Cluster < MeanModel > > clusters ) { int totalSize = relation . size ( ) ; int clusterBoundary = clusters . size ( ) - 1 ; int cumulativeSize = 0 ; for ( int i = 0 ; i < clusters . size ( ) - 1 ; i ++ ) { cumulativeSize += clusters . get ( i ) . size ( ) ; // Given majority covered by large cluster if ( cumulativeSize >= totalSize * alpha ) { clusterBoundary = i ; break ; } // Relative difference in cluster size between two consecutive clusters if ( clusters . get ( i ) . size ( ) / ( double ) clusters . get ( i + 1 ) . size ( ) >= beta ) { clusterBoundary = i ; break ; } } return clusterBoundary ; }
Compute the boundary index separating the large cluster from the small cluster .