Documentation of 'jsat.linear.vectorcollection.VectorCollection' Java class
VectorCollection
jsat.linear.vectorcollection

Interface VectorCollection<V extends Vec>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method and Description
      default void build(boolean parallel, java.util.List<V> collection)
      Builds this metric index from the given collection of points using whatever distance metric is currently set for the metric index.
      void build(boolean parallel, java.util.List<V> collection, DistanceMetric dm)
      Builds this metric index from the given collection of points using the given distance metric.
      default void build(java.util.List<V> collection)
      Builds this metric index from the given collection of points using whatever distance metric is currently set for the metric index.
      default void build(java.util.List<V> collection, DistanceMetric dm)
      Builds this metric index from the given collection of points using the given distance metric.
      VectorCollection<V> clone() 
      V get(int indx)
      Accesses a vector from this collection via index.
      java.util.List<java.lang.Double> getAccelerationCache() 
      DistanceMetric getDistanceMetric() 
      default java.util.List<Vec> getVecs() 
      default void search(java.util.List<V> Q, double r_min, double r_max, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel) 
      default void search(java.util.List<V> Q, int numNeighbors, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel) 
      default java.util.List<? extends VecPaired<V,java.lang.Double>> search(Vec query, double range)
      Deprecated. 
      This API is from the original JSAT interface. It will be removed in the future.
      void search(Vec query, double range, java.util.List<java.lang.Integer> neighbors, java.util.List<java.lang.Double> distances)
      Performs a range search of the current collection.
      default java.util.List<? extends VecPaired<V,java.lang.Double>> search(Vec query, int num_neighbors)
      Deprecated. 
      This API is from the original JSAT interface. It will be removed in the future.
      void search(Vec query, int numNeighbors, java.util.List<java.lang.Integer> neighbors, java.util.List<java.lang.Double> distances)
      Performs k-Nearest Neighbor search of the current collection.
      default void search(VectorCollection<V> Q, double r_min, double r_max, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel) 
      default void search(VectorCollection<V> Q, int numNeighbors, java.util.List<java.util.List<java.lang.Integer>> neighbors, java.util.List<java.util.List<java.lang.Double>> distances, boolean parallel) 
      void setDistanceMetric(DistanceMetric dm)
      Sets the distance metric used for this collection.
      int size()
      Returns the number of vectors stored in the collection
    • Method Detail

      • build

        default void build(java.util.List<V> collection)
        Builds this metric index from the given collection of points using whatever distance metric is currently set for the metric index.
        Parameters:
        collection - the list of vectors to put into the index
      • build

        default void build(java.util.List<V> collection,
                           DistanceMetric dm)
        Builds this metric index from the given collection of points using the given distance metric.
        Parameters:
        collection - the list of vectors to put into the index
        dm - the distance metric to build the index using.
      • build

        default void build(boolean parallel,
                           java.util.List<V> collection)
        Builds this metric index from the given collection of points using whatever distance metric is currently set for the metric index.
        Parameters:
        parallel - true if the index should be built in parallel, or false if it should be done in a single thread.
        collection - the list of vectors to put into the index
      • build

        void build(boolean parallel,
                   java.util.List<V> collection,
                   DistanceMetric dm)
        Builds this metric index from the given collection of points using the given distance metric.
        Parameters:
        parallel - true if the index should be built in parallel, or false if it should be done in a single thread.
        collection - the list of vectors to put into the index
        dm - the distance metric to build the index using.
      • setDistanceMetric

        void setDistanceMetric(DistanceMetric dm)
        Sets the distance metric used for this collection.
        Parameters:
        dm - the distance metric to use
      • getDistanceMetric

        DistanceMetric getDistanceMetric()
        Returns:
        the distance metric to use
      • search

        default java.util.List<? extends VecPaired<V,java.lang.Double>> search(Vec query,
                                                                               double range)
        Deprecated. This API is from the original JSAT interface. It will be removed in the future.
        Searches the space for all vectors that are within a given range of the query vector.
        Parameters:
        query - the vector we want to find others near
        range - the search range around our query
        Returns:
        the list of all vectors within the range of our query. The paired value contains the distance to the query vector.
      • search

        default java.util.List<? extends VecPaired<V,java.lang.Double>> search(Vec query,
                                                                               int num_neighbors)
        Deprecated. This API is from the original JSAT interface. It will be removed in the future.
        Searches the space for the k neighbors that are closest to the given query vector
        Parameters:
        query - the vector we want to find neighbors of
        num_neighbors - the maximum number of neighbors to return
        Returns:
        the list the k nearest neighbors, in sorted order from closest to farthest. The paired value contains the distance to the query vector
      • search

        void search(Vec query,
                    double range,
                    java.util.List<java.lang.Integer> neighbors,
                    java.util.List<java.lang.Double> distances)
        Performs a range search of the current collection. The index and distance of each found neighbor will be placed into the given Lists.
        Parameters:
        query - the point to search for the neighbors within a given radius.
        range - the radius to search for all the neighbors with a distance ≤ range.
        neighbors - the list to store the index of the neighbors in. Will be sorted by distance to the query, and paired with the values in distances.
        distances - the list to store the distance of the neighbors to the query in. Will be sorted, and paired with the values in neighbors.
      • search

        void search(Vec query,
                    int numNeighbors,
                    java.util.List<java.lang.Integer> neighbors,
                    java.util.List<java.lang.Double> distances)
        Performs k-Nearest Neighbor search of the current collection. The index and distance of each found neighbor will be placed into the given Lists.
        Parameters:
        query - the point to search for the k-nearest neighbors of
        numNeighbors - the number of neighbors k to search for.
        neighbors - the list to store the index of the neighbors in. Will be sorted by distance to the query, and paired with the values in distances.
        distances - the list to store the distance of the neighbors to the query in. Will be sorted, and paired with the values in neighbors.
      • get

        V get(int indx)
        Accesses a vector from this collection via index.
        Parameters:
        indx - the index in [0, size()) of the vector to access
        Returns:
        the vector from the collection
      • getAccelerationCache

        java.util.List<java.lang.Double> getAccelerationCache()
      • size

        int size()
        Returns the number of vectors stored in the collection
        Returns:
        the size of the collection
      • search

        default void search(java.util.List<V> Q,
                            double r_min,
                            double r_max,
                            java.util.List<java.util.List<java.lang.Integer>> neighbors,
                            java.util.List<java.util.List<java.lang.Double>> distances,
                            boolean parallel)
      • search

        default void search(VectorCollection<V> Q,
                            double r_min,
                            double r_max,
                            java.util.List<java.util.List<java.lang.Integer>> neighbors,
                            java.util.List<java.util.List<java.lang.Double>> distances,
                            boolean parallel)
      • search

        default void search(java.util.List<V> Q,
                            int numNeighbors,
                            java.util.List<java.util.List<java.lang.Integer>> neighbors,
                            java.util.List<java.util.List<java.lang.Double>> distances,
                            boolean parallel)
      • search

        default void search(VectorCollection<V> Q,
                            int numNeighbors,
                            java.util.List<java.util.List<java.lang.Integer>> neighbors,
                            java.util.List<java.util.List<java.lang.Double>> distances,
                            boolean parallel)
      • getVecs

        default java.util.List<Vec> getVecs()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.