构造函数(有参构造)
接口定义
KBest(int K_features, int R, int L, int A, const char *metric, const std::string &init_builder_type);
KBest(int K_features, int R, int L, float A, int graph_opt_iter, const std::string &metric, const std::string &init_builder_type, const std::string &index_type);
接口用途
初始化构建图检索。
参数说明
参数名称 |
描述 |
数据类型 |
取值范围 |
---|---|---|---|
K_features |
特征维度。 |
int |
[1,2999] |
R |
邻居节点数。 |
int |
[11,499] |
L |
构图时的候选节点列表大小。 |
int |
[11,1999] |
A |
构图剪枝时的角度阈值。 |
int |
[1,360] |
metric |
距离度量的方式。 |
const char * |
“L2”或“IP”。
|
init_builder_type |
构建k近邻图的算法。 |
const std::string & |
“RNNDescent”或“NNDescent”,表示两种不同的构建k近邻图的算法,常使用“RNNDescent”。 |
graph_opt_iter |
图索引自我迭代的轮数。 |
int |
[0,30] |
index_type |
选择邻居策略。 |
const std::string & |
“HNSW”或“NSG”或“TSDG”或“SSG”,表示四种不同的选择邻居策略。 |
父主题: C++