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 classDiSH.Instance.SorterSort new candidates by their distance, for determining the core size.
-
Field Summary
Fields Modifier and Type Field Description private ArrayModifiableDBIDsclusterOrderCluster order.private WritableDataStore<long[]>commonPreferenceVectorsShared preference vectors.private WritableIntegerDataStorecorrelationValueCorrelation value.protected WritableDataStore<long[]>preferenceVectorsThe precomputed preference vectors.private Relation<? extends NumberVector>relationData relation.(package private) java.util.Comparator<DBIDRef>tmpcompSort object by the temporary fields.private WritableIntegerDataStoretmpCorrelationTemporary storage of correlation values.private WritableDoubleDataStoretmpDistanceTemporary storage of distances.private ArrayModifiableDBIDstmpIdsTemporary ids.private WritableDataStore<long[]>tmpPreferenceVectorsTemporary 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.DiSHClusterOrderbuildResult()Build the final result.intcompare(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 voidexpandDBID(DBIDRef id)Add the current DBID to the cluster order, and expand its neighbors if minPts and similar conditions are satisfied.protected LogginggetLogger()Get the class logger.protected voidinitialDBID(DBIDRef id)Initialize for a new DBID.private intmax(java.util.Map<java.lang.Integer,ModifiableDBIDs> candidates)Returns the set with the maximum size contained in the specified map.private intmaxIntersection(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.DiSHClusterOrderrun()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.InstanceProcess the data set.- Overrides:
runin 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.InstanceBuild the final result.- Specified by:
buildResultin classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>- Returns:
- Result
-
initialDBID
protected void initialDBID(DBIDRef id)
Description copied from class:GeneralizedOPTICS.InstanceInitialize for a new DBID.- Specified by:
initialDBIDin classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>- Parameters:
id- Current object ID
-
expandDBID
protected void expandDBID(DBIDRef id)
Description copied from class:GeneralizedOPTICS.InstanceAdd the current DBID to the cluster order, and expand its neighbors if minPts and similar conditions are satisfied.- Specified by:
expandDBIDin classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>- Parameters:
id- Current object ID
-
compare
public int compare(DBIDRef o1, DBIDRef o2)
- Specified by:
comparein interfacejava.util.Comparator<DBIDRef>- Overrides:
comparein classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>
-
getLogger
protected Logging getLogger()
Description copied from class:GeneralizedOPTICS.InstanceGet the class logger.- Specified by:
getLoggerin classGeneralizedOPTICS.Instance<DiSH.DiSHClusterOrder>- Returns:
- Class logger
-
-