鲲鹏社区首页
中文
注册
开发者
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

构造函数(有参构造)

接口定义

KBest(int dim, int R, int L, int A, const char *metric, const std::string &init_builder_type);

KBest(int dim, 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);

接口用途

初始化构建图检索。

参数说明

参数名称

数据类型

描述

取值范围

dim

int

特征维度。

[1,2999]

R

int

邻居节点数。

[11,499]

L

int

构图时的候选节点列表大小。

[11,1999]

A

int

构图剪枝时的角度阈值。

[11,360]

metric

const char *

距离度量的方式。

“L2”“IP”

  • “L2”为欧几里得距离。
  • “IP”为内积距离。

init_builder_type

const std::string &

构建k近邻图的算法。

“RNNDescent”“NNDescent”,表示两种不同的构建k近邻图的算法,常使用“RNNDescent”

graph_opt_iter

int

图索引自我迭代的轮数。

[0,30]

index_type

const std::string &

选择邻居策略。

“HNSW”“NSG”“TSDG”“SSG”,表示四种不同的选择邻居策略。