Interface NeighboursQuery

All Known Implementing Classes:
KDTree, NeighboursBruteForce

public interface NeighboursQuery
An interface for nearest neighbour query objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<List<com.oracle.labs.mlrg.olcut.util.Pair<Integer,Double>>>
    query(SGDVector[] points, int k)
    Queries a set of SGDVectors to determine the k points nearest to the provided points.
    List<com.oracle.labs.mlrg.olcut.util.Pair<Integer,Double>>
    query(SGDVector point, int k)
    Queries a set of SGDVectors to determine the k points nearest to the provided point.
    List<List<com.oracle.labs.mlrg.olcut.util.Pair<Integer,Double>>>
    queryAll(int k)
    Queries a set of SGDVectors to determine the k points nearest to every point in the set.
  • Method Details

    • query

      List<com.oracle.labs.mlrg.olcut.util.Pair<Integer,Double>> query(SGDVector point, int k)
      Queries a set of SGDVectors to determine the k points nearest to the provided point. When there are multiple points equidistant from the provided point, the order in which they are returned may vary depending on the implementation.
      Parameters:
      point - The point to determine the nearest k points for.
      k - The number of neighbouring points to identify.
      Returns:
      A list of k Pairs, where a pair contains the index of the neighbouring point in the original data and the distance between this point and the provided point.
    • query

      List<List<com.oracle.labs.mlrg.olcut.util.Pair<Integer,Double>>> query(SGDVector[] points, int k)
      Queries a set of SGDVectors to determine the k points nearest to the provided points. When there are multiple points equidistant from a provided point, the order in which they are returned may vary depending on the implementation.
      Parameters:
      points - An array of points to determine the nearest k points for.
      k - The number of neighbouring points to identify.
      Returns:
      An list containing lists of k Pairs. There is list entry for each provided point which is a list of k pairs. Each pair contains the index of the neighbouring point in the original data and the distance between this point and the provided point.
    • queryAll

      List<List<com.oracle.labs.mlrg.olcut.util.Pair<Integer,Double>>> queryAll(int k)
      Queries a set of SGDVectors to determine the k points nearest to every point in the set. When there are multiple points equidistant from a point in the set, the order in which they are returned may vary depending on the implementation.
      Parameters:
      k - The number of neighbouring points to identify.
      Returns:
      A list containing lists of k Pairs. There is list entry for each provided point which is a list of k pairs. Each pair contains the index of the neighbouring point in the original data and the distance between this point and the provided point.