Class SharedNearestNeighborSimilarity<O>

  • Type Parameters:
    O - object type
    All Implemented Interfaces:
    elki.similarity.IndexBasedSimilarity<O>, elki.similarity.Similarity<O>

    public class SharedNearestNeighborSimilarity<O>
    extends elki.similarity.AbstractIndexBasedSimilarity<O,​SharedNearestNeighborIndex.Factory<O>>
    SharedNearestNeighborSimilarity with a pattern defined to accept Strings that define a non-negative Integer.
    Since:
    0.1
    Author:
    Arthur Zimek
    • Constructor Detail

      • SharedNearestNeighborSimilarity

        public SharedNearestNeighborSimilarity​(SharedNearestNeighborIndex.Factory<O> indexFactory)
        Constructor.
        Parameters:
        indexFactory - Index factory.
    • Method Detail

      • countSharedNeighbors

        protected static int countSharedNeighbors​(elki.database.ids.DBIDs neighbors1,
                                                  elki.database.ids.DBIDs neighbors2)
        Compute the intersection size
        Parameters:
        neighbors1 - SORTED neighbors of first
        neighbors2 - SORTED neighbors of second
        Returns:
        Intersection size
      • instantiate

        public <T extends OSharedNearestNeighborSimilarity.Instance<T> instantiate​(elki.database.relation.Relation<T> database)
        Specified by:
        instantiate in interface elki.similarity.IndexBasedSimilarity<O>
        Specified by:
        instantiate in interface elki.similarity.Similarity<O>
        Specified by:
        instantiate in class elki.similarity.AbstractIndexBasedSimilarity<O,​SharedNearestNeighborIndex.Factory<O>>