当前位置:网站首页>隐私计算FATE-离线预测
隐私计算FATE-离线预测
2022-06-27 12:37:00 【51CTO】
 隐私计算FATE-离线预测_Fate](/img/7e/9f1777e5da5043c824817180d09ba8.png)
一、说明
Fate 的模型预测有 离线预测 和 在线预测 两种方式,两者的效果是一样的,主要是使用方式、适用场景、高可用、性能等方面有很大差别;本文分享使用 Fate 基于 纵向逻辑回归 算法训练出来的模型进行离线预测实践。
- 基于上文 《 隐私计算FATE-模型训练》 中训练出来的模型进行预测任务
- 关于 Fate 的基础概览和安装部署可参考文章 《 隐私计算FATE-关键概念与单机部署指南》
二、查询模型信息
执行以下命令,进入 Fate 的容器中:
首先我们需要获取模型对应的 model_id 和 model_version 信息,可以通过 job_id 执行以下命令获取:
job_id 可以在 FATE Board 中查看。
执行成功后会返回对应的模型信息,以及在指定目录下生成一个文件夹 job_202205070226373055640_config
{
"data": {
"job_id":
"202205070226373055640",
"model_info": {
"model_id":
"arbiter-10000#guest-9999#host-10000#model",
"model_version":
"202205070226373055640"
},
"train_runtime_conf": {}
},
"retcode":
0,
"retmsg":
"download successfully, please check /data/projects/fate/examples/my_test/job_202205070226373055640_config directory",
"directory":
"/data/projects/fate/examples/my_test/job_202205070226373055640_config"
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
job_202205070226373055640_config 里面包含4个文件:
- dsl.json:任务的 dsl 配置。
- model_info.json:模型信息。
- runtime_conf.json:任务的运行配置。
- train_runtime_conf.json:空。
三、模型部署
执行以下命令:
分别通过 --model-id 与 --model-version 指定上面步骤查询到的 model_id 和 model_version
部署成功后返回:
{
"data": {
"arbiter": {
"10000":
0
},
"detail": {
"arbiter": {
"10000": {
"retcode":
0,
"retmsg":
"deploy model of role arbiter 10000 success"
}
},
"guest": {
"9999": {
"retcode":
0,
"retmsg":
"deploy model of role guest 9999 success"
}
},
"host": {
"10000": {
"retcode":
0,
"retmsg":
"deploy model of role host 10000 success"
}
}
},
"guest": {
"9999":
0
},
"host": {
"10000":
0
},
"model_id":
"arbiter-10000#guest-9999#host-10000#model",
"model_version":
"202205070730131040240"
},
"retcode":
0,
"retmsg":
"success"
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
部署成功后返回一个新的 model_version
四、准备预测配置
执行以下命令:
直接把 Fate 自带的纵向逻辑回归算法预测配置样例,复制到我们的
my_test 目录下。
 隐私计算FATE-离线预测_Fate_02](/img/d9/f75ce67196963e82c42c79a1d41db8.png)
预测的配置文件主要配置三部分:
- 上面部分为配置发起者以及参与方角色
- 中间部分需要填入正确的模型信息
- 下面的则为预测使用的数据表
唯一需要修改的就是中间的 模型信息 部分;需要注意的是这里输入的版本号是 模型部署 后返回的版本号,并且需要增加 job_type 为 predict 指定任务类型为预测任务。
五、执行预测任务
执行以下命令:
与模型训练一样也是使用 submit 命令,通过 -c 指定配置文件。
执行成功后返回:
{
"data": {
"board_url":
"http://127.0.0.1:8080/index.html#/dashboard?job_id=202205070731385067720&role=guest&party_id=9999",
"code":
0,
"dsl_path":
"/data/projects/fate/fateflow/jobs/202205070731385067720/job_dsl.json",
"job_id":
"202205070731385067720",
"logs_directory":
"/data/projects/fate/fateflow/logs/202205070731385067720",
"message":
"success",
"model_info": {
"model_id":
"arbiter-10000#guest-9999#host-10000#model",
"model_version":
"202205070730131040240"
},
"pipeline_dsl_path":
"/data/projects/fate/fateflow/jobs/202205070731385067720/pipeline_dsl.json",
"runtime_conf_on_party_path":
"/data/projects/fate/fateflow/jobs/202205070731385067720/guest/9999/job_runtime_on_party_conf.json",
"runtime_conf_path":
"/data/projects/fate/fateflow/jobs/202205070731385067720/job_runtime_conf.json",
"train_runtime_conf_path":
"/data/projects/fate/fateflow/jobs/202205070731385067720/train_runtime_conf.json"
},
"jobId":
"202205070731385067720",
"retcode":
0,
"retmsg":
"success"
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
六、查看预测结果
可以通过返回的 board_url 或者 job_id 去 FATE Board 里查看结果,但是图形化界面里最多只能查看 100 条记录; 我们可以通过 output-data 命令,导出指定组件的所有数据输出:
指定中的任务id和组件名大家需按实际修改。
- -j:指定预测任务的 job_id
- -cpn:指定组件名。
- -o:指定输出的目录。
执行成功后返回:
{
"retcode":
0,
"directory":
"/data/projects/fate/examples/my_test/predict/job_202205070731385067720_hetero_lr_0_guest_9999_output_data",
"retmsg":
"Download successfully, please check /data/projects/fate/examples/my_test/predict/job_202205070731385067720_hetero_lr_0_guest_9999_output_data directory"
}
- 1.
- 2.
- 3.
- 4.
- 5.
在目录 /data/projects/fate/examples/my_test/predict/job_202205070731385067720_hetero_lr_0_guest_9999_output_data 中可以看到两个文件:
- data.csv:为输出的所有数据。
- data.meta:为数据的列头。
边栏推荐
- JMETER连接DM8
- 推荐系统的下一步?阿里时空聚合GNN,效果吊打LightGCN!
- Script defer async mode
- Convn-n dimensional convolution
- build. Gradle configuration
- How to download pictures with hyperlinks
- 全志A13折腾备忘
- [fans' welfare] today, I'd like to introduce a method to collect money for nothing - convertible bonds. I personally verified that each person can earn 1500 yuan a year
- threejs的环境光+点光源+平行光源+球面光 以及hepler理解+阴影()
- Secyun won the "2022 AI analysis · it operation and maintenance vendor panorama report" as the representative vendor of intelligent operation and maintenance aiops Market
猜你喜欢

MySQL高阶语句(一)

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing

Size end byte order

Uni app develops wechat applet to dynamically render pages and dynamically change the order of page component modules

浅谈软件研发的复杂性与效能提升之道

本地可视化工具连接阿里云centOS服务器的redis

如何下载带有超链接的图片

ssh工作流程及原理

Dm8: Dameng database - lock timeout

【Acwing】第57场周赛 题解
随机推荐
log4j. Detailed configuration of properties
和动态规划的第一次相遇
一个有趣的网络掩码的实验
今晚战码先锋润和赛道第2期直播丨如何参与OpenHarmony代码贡献
Configuration of YML
Socket blocking and non blocking modes
How to open an account for CSI 500 stock index futures, what are the regular domestic stock index futures platforms, and where is the safest place to open an account?
消息隊列的使用
Local visualization tool connects to redis of Alibaba cloud CentOS server
【粉丝福利】今天给大家介绍一个白捡钱的方法-可转债,本人亲自验证,每年每人能获利1500元
消息队列的使用
OpenFeign服务接口调用
【TcaplusDB知识库】TcaplusDB-tcapulogmgr工具介绍(一)
ViewPager2使用记录
Threejs' ambient light + point light + parallel light + spherical light and Hepler understanding + shadow ()
Airbnb复盘微服务
Detailed configuration of log4j
Snipaste, the world's strongest screenshot software
First encounter with dynamic programming
【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(二)