Classes | Namespaces | Functions
knn.hpp File Reference
#include <raft/spatial/knn/ball_cover_types.hpp>
#include <raft/spatial/knn/detail/processing.hpp>
#include <cuvs/distance/distance.hpp>
#include <cuvs/neighbors/ivf_flat.hpp>
#include <cuvs/neighbors/ivf_pq.hpp>
Include dependency graph for knn.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ML::knnIndex
 
struct  ML::knnIndexParam
 
struct  ML::IVFParam
 
struct  ML::IVFFlatParam
 
struct  ML::IVFPQParam
 

Namespaces

 raft
 
 ML
 

Functions

void ML::brute_force_knn (const raft::handle_t &handle, std::vector< float * > &input, std::vector< int > &sizes, int D, float *search_items, int n, int64_t *res_I, float *res_D, int k, bool rowMajorIndex=false, bool rowMajorQuery=false, cuvs::distance::DistanceType metric=cuvs::distance::DistanceType::L2Expanded, float metric_arg=2.0f, std::vector< int64_t > *translations=nullptr)
 Flat C++ API function to perform a brute force knn on a series of input arrays and combine the results into a single output array for indexes and distances. More...
 
void ML::rbc_build_index (const raft::handle_t &handle, raft::spatial::knn::BallCoverIndex< int64_t, float, uint32_t > &index)
 
void ML::rbc_knn_query (const raft::handle_t &handle, raft::spatial::knn::BallCoverIndex< int64_t, float, uint32_t > &index, uint32_t k, const float *search_items, uint32_t n_search_items, int64_t *out_inds, float *out_dists)
 
void ML::approx_knn_build_index (raft::handle_t &handle, knnIndex *index, knnIndexParam *params, cuvs::distance::DistanceType metric, float metricArg, float *index_array, int n, int D)
 Flat C++ API function to build an approximate nearest neighbors index from an index array and a set of parameters. More...
 
void ML::approx_knn_search (raft::handle_t &handle, float *distances, int64_t *indices, knnIndex *index, int k, float *query_array, int n)
 Flat C++ API function to perform an approximate nearest neighbors search from previously built index and a query array. More...
 
void ML::knn_classify (raft::handle_t &handle, int *out, int64_t *knn_indices, std::vector< int * > &y, size_t n_index_rows, size_t n_query_rows, int k)
 Flat C++ API function to perform a knn classification using a given a vector of label arrays. This supports multilabel classification by classifying on multiple label arrays. Note that each label is classified independently, as is done in scikit-learn. More...
 
void ML::knn_regress (raft::handle_t &handle, float *out, int64_t *knn_indices, std::vector< float * > &y, size_t n_index_rows, size_t n_query_rows, int k)
 Flat C++ API function to perform a knn regression using a given a vector of label arrays. This supports multilabel regression by classifying on multiple label arrays. Note that each label is classified independently, as is done in scikit-learn. More...
 
void ML::knn_class_proba (raft::handle_t &handle, std::vector< float * > &out, int64_t *knn_indices, std::vector< int * > &y, size_t n_index_rows, size_t n_query_rows, int k)
 Flat C++ API function to compute knn class probabilities using a vector of device arrays containing discrete class labels. Note that the output is a vector, which is. More...