Search in sources :

Example 16 with Pair

use of de.lmu.ifi.dbs.elki.utilities.pairs.Pair in project elki by elki-project.

the class CLIQUESubspace method determineClusters.

/**
 * Determines all clusters in this subspace by performing a depth-first search
 * algorithm to find connected dense units.
 *
 * @return the clusters in this subspace and the corresponding cluster models
 */
public List<Pair<Subspace, ModifiableDBIDs>> determineClusters() {
    List<Pair<Subspace, ModifiableDBIDs>> clusters = new ArrayList<>();
    for (CLIQUEUnit<V> unit : getDenseUnits()) {
        if (!unit.isAssigned()) {
            ModifiableDBIDs cluster = DBIDUtil.newHashSet();
            CLIQUESubspace<V> model = new CLIQUESubspace<>(getDimensions());
            clusters.add(new Pair<Subspace, ModifiableDBIDs>(model, cluster));
            dfs(unit, cluster, model);
        }
    }
    return clusters;
}
Also used : ArrayList(java.util.ArrayList) Subspace(de.lmu.ifi.dbs.elki.data.Subspace) ModifiableDBIDs(de.lmu.ifi.dbs.elki.database.ids.ModifiableDBIDs) Pair(de.lmu.ifi.dbs.elki.utilities.pairs.Pair)

Aggregations

Pair (de.lmu.ifi.dbs.elki.utilities.pairs.Pair)16 ArrayList (java.util.ArrayList)10 ArrayModifiableDBIDs (de.lmu.ifi.dbs.elki.database.ids.ArrayModifiableDBIDs)6 DBIDIter (de.lmu.ifi.dbs.elki.database.ids.DBIDIter)6 ModifiableDBIDs (de.lmu.ifi.dbs.elki.database.ids.ModifiableDBIDs)6 List (java.util.List)4 Cluster (de.lmu.ifi.dbs.elki.data.Cluster)3 Clustering (de.lmu.ifi.dbs.elki.data.Clustering)3 NumberVector (de.lmu.ifi.dbs.elki.data.NumberVector)3 Subspace (de.lmu.ifi.dbs.elki.data.Subspace)3 FiniteProgress (de.lmu.ifi.dbs.elki.logging.progress.FiniteProgress)3 IOException (java.io.IOException)3 SubspaceModel (de.lmu.ifi.dbs.elki.data.model.SubspaceModel)2 WritableDoubleDataStore (de.lmu.ifi.dbs.elki.database.datastore.WritableDoubleDataStore)2 DBIDVar (de.lmu.ifi.dbs.elki.database.ids.DBIDVar)2 DoubleRelation (de.lmu.ifi.dbs.elki.database.relation.DoubleRelation)2 MaterializedDoubleRelation (de.lmu.ifi.dbs.elki.database.relation.MaterializedDoubleRelation)2 StepProgress (de.lmu.ifi.dbs.elki.logging.progress.StepProgress)2 DoubleMinMax (de.lmu.ifi.dbs.elki.math.DoubleMinMax)2 BasicOutlierScoreMeta (de.lmu.ifi.dbs.elki.result.outlier.BasicOutlierScoreMeta)2