jsat.linear.vectorcollection
Class VectorCollectionUtils
- java.lang.Object
-
- jsat.linear.vectorcollection.VectorCollectionUtils
-
public class VectorCollectionUtils extends java.lang.ObjectA collection of common utility methods to perform on aVectorCollection
-
-
Constructor Summary
Constructors Constructor and Description VectorCollectionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description static <V0 extends Vec,V1 extends Vec>
java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>>allEpsNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, double radius, boolean parallel)Searches the given collection for all the neighbors within a distance of radius for every data point in the given search list.static <V0 extends Vec,V1 extends Vec>
java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>>allEpsNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, double radius, java.util.concurrent.ExecutorService threadpool)Searches the given collection for all the neighbors within a distance of radius for every data point in the given search list.static <V0 extends Vec,V1 extends Vec>
java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>>allNearestNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, int k)Searches the given collection for the k nearest neighbors for every data point in the given search list.static <V0 extends Vec,V1 extends Vec>
java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>>allNearestNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, int k, boolean parallel)Searches the given collection for the k nearest neighbors for every data point in the given search list.static <V0 extends Vec,V1 extends Vec>
java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>>allNearestNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, int k, java.util.concurrent.ExecutorService threadpool)Deprecated.This will be deleted soonstatic <V0 extends Vec,V1 extends Vec>
java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>>allNearestNeighbors(VectorCollection<V0> collection, V1[] search, int k)Searches the given collection for the k nearest neighbors for every data point in the given search list.static <V0 extends Vec,V1 extends Vec>
java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>>allNearestNeighbors(VectorCollection<V0> collection, V1[] search, int k, java.util.concurrent.ExecutorService threadpool)Searches the given collection for the k nearest neighbors for every data point in the given search list.static <V0 extends Vec,V1 extends Vec>
OnLineStatisticsgetKthNeighborStats(VectorCollection<V0> collection, java.util.List<V1> search, int k)Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.static <V0 extends Vec,V1 extends Vec>
OnLineStatisticsgetKthNeighborStats(VectorCollection<V0> collection, java.util.List<V1> search, int k, java.util.concurrent.ExecutorService threadpool)Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.static <V0 extends Vec,V1 extends Vec>
OnLineStatisticsgetKthNeighborStats(VectorCollection<V0> collection, V1[] search, int k)Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.static <V0 extends Vec,V1 extends Vec>
OnLineStatisticsgetKthNeighborStats(VectorCollection<V0> collection, V1[] search, int k, java.util.concurrent.ExecutorService threadpool)Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.
-
-
-
Method Detail
-
allNearestNeighbors
public static <V0 extends Vec,V1 extends Vec> java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>> allNearestNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, int k)
Searches the given collection for the k nearest neighbors for every data point in the given search list.- Type Parameters:
V0- the vector type in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection to search fromsearch- the vectors to search fork- the number of nearest neighbors- Returns:
- The list of lists for all nearest neighbors
-
allNearestNeighbors
public static <V0 extends Vec,V1 extends Vec> java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>> allNearestNeighbors(VectorCollection<V0> collection, V1[] search, int k)
Searches the given collection for the k nearest neighbors for every data point in the given search list.- Type Parameters:
V0- the vector type in the collectionV1- the type of vector in the search array- Parameters:
collection- the collection to search fromsearch- the vectors to search fork- the number of nearest neighbors- Returns:
- The list of lists for all nearest neighbors
-
allNearestNeighbors
public static <V0 extends Vec,V1 extends Vec> java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>> allNearestNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, int k, java.util.concurrent.ExecutorService threadpool)
Deprecated. This will be deleted soonSearches the given collection for the k nearest neighbors for every data point in the given search list.- Type Parameters:
V0- the vector type in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection to search fromsearch- the vectors to search fork- the number of nearest neighborsthreadpool- the source of threads to perform the computation in parallel- Returns:
- The list of lists for all nearest neighbors
-
allNearestNeighbors
public static <V0 extends Vec,V1 extends Vec> java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>> allNearestNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, int k, boolean parallel)
Searches the given collection for the k nearest neighbors for every data point in the given search list.- Type Parameters:
V0- the vector type in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection to search fromsearch- the vectors to search fork- the number of nearest neighborsparallel-trueif multiple threads should be used to perform clustering.falseif it should be done in a single threaded manner.- Returns:
- The list of lists for all nearest neighbors
-
allEpsNeighbors
public static <V0 extends Vec,V1 extends Vec> java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>> allEpsNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, double radius, java.util.concurrent.ExecutorService threadpool)
Searches the given collection for all the neighbors within a distance of radius for every data point in the given search list.- Type Parameters:
V0- the vector type in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection to search fromsearch- the vectors to search forradius- the distance to search for neighborsthreadpool- the source of threads to perform the computation in parallel- Returns:
- The list of lists for all nearest neighbors
-
allEpsNeighbors
public static <V0 extends Vec,V1 extends Vec> java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>> allEpsNeighbors(VectorCollection<V0> collection, java.util.List<V1> search, double radius, boolean parallel)
Searches the given collection for all the neighbors within a distance of radius for every data point in the given search list.- Type Parameters:
V0- the vector type in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection to search fromsearch- the vectors to search forradius- the distance to search for neighborsparallel-trueif multiple threads should be used to perform clustering.falseif it should be done in a single threaded manner.- Returns:
- The list of lists for all nearest neighbors
-
allNearestNeighbors
public static <V0 extends Vec,V1 extends Vec> java.util.List<java.util.List<? extends VecPaired<V0,java.lang.Double>>> allNearestNeighbors(VectorCollection<V0> collection, V1[] search, int k, java.util.concurrent.ExecutorService threadpool)
Searches the given collection for the k nearest neighbors for every data point in the given search list.- Type Parameters:
V0- the vector type in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection to search fromsearch- the vectors to search fork- the number of nearest neighborsthreadpool- the source of threads to perform the computation in parallel- Returns:
- The list of lists for all nearest neighbors
-
getKthNeighborStats
public static <V0 extends Vec,V1 extends Vec> OnLineStatistics getKthNeighborStats(VectorCollection<V0> collection, java.util.List<V1> search, int k)
Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.- Type Parameters:
V0- the type of vector in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection of vectors to query fromsearch- the list of vectors to search fork- the nearest neighbor to use- Returns:
- the statistics for the distance of the k'th nearest neighbor from the query point
-
getKthNeighborStats
public static <V0 extends Vec,V1 extends Vec> OnLineStatistics getKthNeighborStats(VectorCollection<V0> collection, V1[] search, int k)
Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.- Type Parameters:
V0- the type of vector in the collectionV1- the type of vector in the search array- Parameters:
collection- the collection of vectors to query fromsearch- the array of vectors to search fork- the nearest neighbor to use- Returns:
- the statistics for the distance of the k'th nearest neighbor from the query point
-
getKthNeighborStats
public static <V0 extends Vec,V1 extends Vec> OnLineStatistics getKthNeighborStats(VectorCollection<V0> collection, java.util.List<V1> search, int k, java.util.concurrent.ExecutorService threadpool)
Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.- Type Parameters:
V0- the type of vector in the collectionV1- the type of vector in the search collection- Parameters:
collection- the collection of vectors to query fromsearch- the list of vectors to search fork- the nearest neighbor to usethreadpool- the source of threads to perform the computation in parallel- Returns:
- the statistics for the distance of the k'th nearest neighbor from the query point
-
getKthNeighborStats
public static <V0 extends Vec,V1 extends Vec> OnLineStatistics getKthNeighborStats(VectorCollection<V0> collection, V1[] search, int k, java.util.concurrent.ExecutorService threadpool)
Computes statistics about the distance of the k'th nearest neighbor for each data point in the search list.- Type Parameters:
V0- the type of vector in the collectionV1- the type of vector in the search array- Parameters:
collection- the collection of vectors to query fromsearch- the array of vectors to search fork- the nearest neighbor to usethreadpool- the source of threads to perform the computation in parallel- Returns:
- the statistics for the distance of the k'th nearest neighbor from the query point
-
-
DataMelt 3.0 © DataMelt by jWork.ORG