Package elki.distance
Class SharedNearestNeighborJaccardDistance.Instance<T>
- java.lang.Object
-
- elki.distance.AbstractIndexBasedDistance.Instance<T,SharedNearestNeighborIndex<T>,SharedNearestNeighborJaccardDistance<T>>
-
- elki.distance.SharedNearestNeighborJaccardDistance.Instance<T>
-
- Type Parameters:
T
- Object type
- All Implemented Interfaces:
DatabaseDistanceQuery<T>
,DistanceQuery<T>
,IndexBasedDistance.Instance<T,SharedNearestNeighborIndex<T>>
- Enclosing class:
- SharedNearestNeighborJaccardDistance<O>
public static class SharedNearestNeighborJaccardDistance.Instance<T> extends AbstractIndexBasedDistance.Instance<T,SharedNearestNeighborIndex<T>,SharedNearestNeighborJaccardDistance<T>>
Actual instance for a dataset.- Author:
- Erich Schubert
-
-
Field Summary
-
Fields inherited from class elki.distance.AbstractIndexBasedDistance.Instance
index, parent, relation
-
-
Constructor Summary
Constructors Constructor Description Instance(Relation<T> database, SharedNearestNeighborIndex<T> preprocessor, SharedNearestNeighborJaccardDistance<T> parent)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(DBIDRef id1, DBIDRef id2)
Returns the distance between the two objects specified by their object ids.protected static double
jaccardCoefficient(DBIDs neighbors1, DBIDs neighbors2)
Compute the Jaccard coefficient-
Methods inherited from class elki.distance.AbstractIndexBasedDistance.Instance
getDistance, getIndex, getRelation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.database.query.distance.DatabaseDistanceQuery
distance, distance, distance
-
-
-
-
Constructor Detail
-
Instance
public Instance(Relation<T> database, SharedNearestNeighborIndex<T> preprocessor, SharedNearestNeighborJaccardDistance<T> parent)
Constructor.- Parameters:
database
- Databasepreprocessor
- Preprocessorparent
- Parent distance
-
-
Method Detail
-
jaccardCoefficient
protected static double jaccardCoefficient(DBIDs neighbors1, DBIDs neighbors2)
Compute the Jaccard coefficient- Parameters:
neighbors1
- SORTED neighbor ids of firstneighbors2
- SORTED neighbor ids of second- Returns:
- Jaccard coefficient
-
distance
public double distance(DBIDRef id1, DBIDRef id2)
Description copied from interface:DistanceQuery
Returns the distance between the two objects specified by their object ids.- Parameters:
id1
- first object idid2
- second object id- Returns:
- the distance between the two objects specified by their object ids
-
-