Package elki.clustering.subspace
Class DiSH.Instance
- java.lang.Object
-
- elki.clustering.optics.GeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
-
- elki.clustering.subspace.DiSH.Instance
-
- All Implemented Interfaces:
java.util.Comparator<DBIDRef>
- Enclosing class:
- DiSH
private class DiSH.Instance extends GeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
OPTICS variant used by DiSH internally.- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
DiSH.Instance.Sorter
Sort new candidates by their distance, for determining the core size.
-
Field Summary
Fields Modifier and Type Field Description private ArrayModifiableDBIDs
clusterOrder
Cluster order.private WritableDataStore<long[]>
commonPreferenceVectors
Shared preference vectors.private WritableIntegerDataStore
correlationValue
Correlation value.protected WritableDataStore<long[]>
preferenceVectors
The precomputed preference vectors.private Relation<? extends NumberVector>
relation
Data relation.(package private) java.util.Comparator<DBIDRef>
tmpcomp
Sort object by the temporary fields.private WritableIntegerDataStore
tmpCorrelation
Temporary storage of correlation values.private WritableDoubleDataStore
tmpDistance
Temporary storage of distances.private ArrayModifiableDBIDs
tmpIds
Temporary ids.private WritableDataStore<long[]>
tmpPreferenceVectors
Temporary storage for new preference vectors.-
Fields inherited from class elki.clustering.optics.GeneralizedOPTICS.Instance
candidates, predecessor, processedIDs, reachability
-
-
Constructor Summary
Constructors Constructor Description Instance(Relation<? extends NumberVector> relation)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DiSH.DiSHClusterOrder
buildResult()
Build the final result.int
compare(DBIDRef o1, DBIDRef o2)
private long[]
determinePreferenceVector(ModifiableDBIDs[] neighborIDs, java.lang.StringBuilder msg)
Determines the preference vector according to the specified neighbor ids.private long[]
determinePreferenceVectorByApriori(ModifiableDBIDs[] neighborIDs, java.lang.StringBuilder msg)
Determines the preference vector with the apriori strategy.private long[]
determinePreferenceVectorByMaxIntersection(ModifiableDBIDs[] neighborIDs, java.lang.StringBuilder msg)
Determines the preference vector with the max intersection strategy.protected void
expandDBID(DBIDRef id)
Add the current DBID to the cluster order, and expand its neighbors if minPts and similar conditions are satisfied.protected Logging
getLogger()
Get the class logger.protected void
initialDBID(DBIDRef id)
Initialize for a new DBID.private int
max(java.util.Map<java.lang.Integer,ModifiableDBIDs> candidates)
Returns the set with the maximum size contained in the specified map.private int
maxIntersection(java.util.Map<java.lang.Integer,ModifiableDBIDs> candidates, ModifiableDBIDs set)
Returns the index of the set having the maximum intersection set with the specified set contained in the specified map.DiSH.DiSHClusterOrder
run()
Process the data set.
-
-
-
Field Detail
-
relation
private Relation<? extends NumberVector> relation
Data relation.
-
clusterOrder
private ArrayModifiableDBIDs clusterOrder
Cluster order.
-
correlationValue
private WritableIntegerDataStore correlationValue
Correlation value.
-
commonPreferenceVectors
private WritableDataStore<long[]> commonPreferenceVectors
Shared preference vectors.
-
tmpIds
private ArrayModifiableDBIDs tmpIds
Temporary ids.
-
tmpCorrelation
private WritableIntegerDataStore tmpCorrelation
Temporary storage of correlation values.
-
tmpDistance
private WritableDoubleDataStore tmpDistance
Temporary storage of distances.
-
tmpcomp
java.util.Comparator<DBIDRef> tmpcomp
Sort object by the temporary fields.
-
preferenceVectors
protected WritableDataStore<long[]> preferenceVectors
The precomputed preference vectors.
-
tmpPreferenceVectors
private WritableDataStore<long[]> tmpPreferenceVectors
Temporary storage for new preference vectors.
-
-
Constructor Detail
-
Instance
public Instance(Relation<? extends NumberVector> relation)
Constructor.- Parameters:
relation
- Relation
-
-
Method Detail
-
run
public DiSH.DiSHClusterOrder run()
Description copied from class:GeneralizedOPTICS.Instance
Process the data set.- Overrides:
run
in classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
- Returns:
- Cluster order result.
-
determinePreferenceVector
private long[] determinePreferenceVector(ModifiableDBIDs[] neighborIDs, java.lang.StringBuilder msg)
Determines the preference vector according to the specified neighbor ids.- Parameters:
neighborIDs
- the list of ids of the neighbors in each dimensionmsg
- a string buffer for debug messages- Returns:
- the preference vector
-
determinePreferenceVectorByApriori
private long[] determinePreferenceVectorByApriori(ModifiableDBIDs[] neighborIDs, java.lang.StringBuilder msg)
Determines the preference vector with the apriori strategy.- Parameters:
neighborIDs
- the list of ids of the neighbors in each dimensionmsg
- a string buffer for debug messages- Returns:
- the preference vector
-
determinePreferenceVectorByMaxIntersection
private long[] determinePreferenceVectorByMaxIntersection(ModifiableDBIDs[] neighborIDs, java.lang.StringBuilder msg)
Determines the preference vector with the max intersection strategy.- Parameters:
neighborIDs
- the list of ids of the neighbors in each dimensionmsg
- a string buffer for debug messages- Returns:
- the preference vector
-
max
private int max(java.util.Map<java.lang.Integer,ModifiableDBIDs> candidates)
Returns the set with the maximum size contained in the specified map.- Parameters:
candidates
- the map containing the sets- Returns:
- the set with the maximum size
-
maxIntersection
private int maxIntersection(java.util.Map<java.lang.Integer,ModifiableDBIDs> candidates, ModifiableDBIDs set)
Returns the index of the set having the maximum intersection set with the specified set contained in the specified map.- Parameters:
candidates
- the map containing the setsset
- the set to intersect with and output the result to- Returns:
- the set with the maximum size
-
buildResult
protected DiSH.DiSHClusterOrder buildResult()
Description copied from class:GeneralizedOPTICS.Instance
Build the final result.- Specified by:
buildResult
in classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
- Returns:
- Result
-
initialDBID
protected void initialDBID(DBIDRef id)
Description copied from class:GeneralizedOPTICS.Instance
Initialize for a new DBID.- Specified by:
initialDBID
in classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
- Parameters:
id
- Current object ID
-
expandDBID
protected void expandDBID(DBIDRef id)
Description copied from class:GeneralizedOPTICS.Instance
Add the current DBID to the cluster order, and expand its neighbors if minPts and similar conditions are satisfied.- Specified by:
expandDBID
in classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
- Parameters:
id
- Current object ID
-
compare
public int compare(DBIDRef o1, DBIDRef o2)
- Specified by:
compare
in interfacejava.util.Comparator<DBIDRef>
- Overrides:
compare
in classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
-
getLogger
protected Logging getLogger()
Description copied from class:GeneralizedOPTICS.Instance
Get the class logger.- Specified by:
getLogger
in classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
- Returns:
- Class logger
-
-