private List < CLIQUESubspace > findOneDimensionalDenseSubspaceCandidates ( Relation < ? extends NumberVector > database ) { Collection < CLIQUEUnit > units = initOneDimensionalUnits ( database ) ; // identify dense units double total = database . size ( ) ; for ( DBIDIter it = database . iterDBIDs ( ) ; it . valid ( ) ; it . advance ( ) ) { NumberVector featureVector = database . get ( it ) ; // FIXME: rather than repeatedly testing, use a clever data structure? for ( CLIQUEUnit unit : units ) { unit . addFeatureVector ( it , featureVector ) ; } } int dimensionality = RelationUtil . dimensionality ( database ) ; Collection < CLIQUEUnit > denseUnits = new ArrayList <> ( ) ; CLIQUESubspace [ ] denseSubspaces = new CLIQUESubspace [ dimensionality ] ; for ( CLIQUEUnit unit : units ) { // unit is a dense unit if ( unit . selectivity ( total ) >= tau ) { denseUnits . add ( unit ) ; // add the one-dimensional dense unit to its subspace int dim = unit . getDimension ( 0 ) ; CLIQUESubspace subspace_d = denseSubspaces [ dim ] ; if ( subspace_d == null ) { denseSubspaces [ dim ] = subspace_d = new CLIQUESubspace ( dim ) ; } subspace_d . addDenseUnit ( unit ) ; } } // Omit null values where no dense unit was found: List < CLIQUESubspace > subspaceCandidates = new ArrayList <> ( dimensionality ) ; for ( CLIQUESubspace s : denseSubspaces ) { if ( s != null ) { subspaceCandidates . add ( s ) ; } } Collections . sort ( subspaceCandidates , CLIQUESubspace . BY_COVERAGE ) ; if ( LOG . isDebugging ( ) ) { LOG . debugFine ( new StringBuilder ( ) . append ( " number of 1-dim dense units: " ) . append ( denseUnits . size ( ) ) // . append ( "\n number of 1-dim dense subspace candidates: " ) . append ( subspaceCandidates . size ( ) ) . toString ( ) ) ; } return subspaceCandidates ; }
Determines the one - dimensional dense subspace candidates by making a pass over the database .