@ Override protected Cluster < SubspaceModel > runDOC ( Database database , Relation < V > relation , ArrayModifiableDBIDs S , int d , int n , int m , int r , int minClusterSize ) { // Relevant attributes of highest cardinality. long [ ] D = null ; // The seed point for the best dimensions. DBIDVar dV = DBIDUtil . newVar ( ) ; // Inform the user about the progress in the current iteration. FiniteProgress iprogress = LOG . isVerbose ( ) ? new FiniteProgress ( "Iteration progress for current cluster" , m * n , LOG ) : null ; Random random = rnd . getSingleThreadedRandom ( ) ; DBIDArrayIter iter = S . iter ( ) ; outer : for ( int i = 0 ; i < n ; ++ i ) { // Pick a random seed point. iter . seek ( random . nextInt ( S . size ( ) ) ) ; for ( int j = 0 ; j < m ; ++ j ) { // Choose a set of random points. DBIDs randomSet = DBIDUtil . randomSample ( S , r , random ) ; // Initialize cluster info. long [ ] nD = BitsUtil . zero ( d ) ; // Test each dimension. for ( int k = 0 ; k < d ; ++ k ) { if ( dimensionIsRelevant ( k , relation , randomSet ) ) { BitsUtil . setI ( nD , k ) ; } } if ( D == null || BitsUtil . cardinality ( nD ) > BitsUtil . cardinality ( D ) ) { D = nD ; dV . set ( iter ) ; if ( BitsUtil . cardinality ( D ) >= d_zero ) { if ( iprogress != null ) { iprogress . setProcessed ( iprogress . getTotal ( ) , LOG ) ; } break outer ; } } LOG . incrementProcessed ( iprogress ) ; } } LOG . ensureCompleted ( iprogress ) ; // If no relevant dimensions were found, skip it. if ( D == null || BitsUtil . cardinality ( D ) == 0 ) { return null ; } // Get all points in the box. DBIDs C = findNeighbors ( dV , D , S , relation ) ; // If we have a non-empty cluster, return it. return ( C . size ( ) >= minClusterSize ) ? makeCluster ( relation , C , D ) : null ; }
Performs a single run of FastDOC finding a single cluster .