联邦XGBoost交互接口
功能介绍
使用联邦XGBoost算法时,客户端与服务端的交互接口。
URL
URL格式
POST https://{{Federal-IP}}/federated/v1/xgboost/interact
参数说明,如表1所示。
参数 |
是否必选 |
类型 |
说明 |
---|---|---|---|
agentId |
Y |
String |
客户端ID |
taskType |
Y |
String |
联邦XGBoost交互任务类型。 取值信息如下所示:
|
classCounts |
N |
int[] |
客户端训练数据类别统计信息,在taskType 为 upload_class_count时需要上传。 |
featDistribute |
N |
String |
客户端训练数据特征分布信息,在taskType为upload_feature_distribute时需要上传。 |
请求
请求样例
{ "agentId": "agentId-gbrcygpc", "taskType": " upload_class_count ", "classCounts": [1000, 4000] }
响应
- 成功响应样例
{ "taskType": "none", "success": true "code": "0", "msg": "success" }
- 失败响应样例
{ "success": false, "code": "23469334.14010.10001", "msg": "you have no right to operator this instance!" }
参数说明, 如表2所示
参数 |
是否必选 |
类型 |
说明 |
---|---|---|---|
code |
N |
String |
状态码。成功为0,失败情况下为非0。 |
msg |
N |
String |
返回的message信息。失败情况下为错误信息。 |
success |
Y |
Boolean |
是否成功 |
taskType |
Y |
String |
联邦XGBoost交互任务类型。 取值信息如下所示:
|
classWeights |
N |
double[] |
server下发的类别权重信息,在taskType为 upload_feature_distribute 时下发,客户端接收后需要保存相关信息。 |
candidates |
N |
String |
Server下发的XGBoost算法候选集信息, 在taskType 为over 时下发,客户端接收后需要保存相关信息。 |
返回值
