当前位置:网站首页>Privacy computing fat - offline prediction
Privacy computing fat - offline prediction
2022-06-28 15:15:00 【zlt2000】

One 、 explain
Fate The model predictions are offline forecast and Online forecasting Two ways , The effect is the same , Mainly the way of use 、 Applicable scenario 、 High availability 、 There are great differences in performance, etc ; This article uses Fate be based on Vertical logistic regression The model trained by the algorithm is used for off-line prediction practice .
- Based on the above 《 Privacy computing FATE - model training 》 The model trained in the
- About Fate Please refer to the article for the basic overview and installation deployment of 《 Privacy computing FATE - Key concepts and stand-alone Deployment Guide 》
Two 、 Query model information
Execute the following command , Get into Fate In the container :
docker exec -it $(docker ps -aqf "name=standalone_fate") bash
First, we need to get the corresponding model_id and model_version Information , Can pass job_id Execute the following command to get :
flow job config -j 202205070226373055640 -r guest -p 9999 --output-path /data/projects/fate/examples/my_test/
job_id Can be in FATE Board View in .
After successful execution, the corresponding model information will be returned , And generate a folder under the specified directory 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"
}
job_202205070226373055640_config It contains 4 File :
- dsl.json: Mission dsl To configure .
- model_info.json: Model information .
- runtime_conf.json: Task running configuration .
- train_runtime_conf.json: empty .
3、 ... and 、 Model deployment
Execute the following command :
flow model deploy --model-id arbiter-10000#guest-9999#host-10000#model --model-version 202205070226373055640
Pass respectively --model-id And --model-version Specify the... Found in the above steps model_id and model_version
After the deployment is successful, return :
{
"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"
}
After successful deployment, a new model_version
Four 、 Prepare forecast configuration
Execute the following command :
cp /data/projects/fate/examples/dsl/v2/hetero_logistic_regression/hetero_lr_normal_predict_conf.json /data/projects/fate/examples/my_test/
Put... Directly Fate The built-in vertical logistic regression algorithm prediction configuration example , Copy it to our
my_testUnder the table of contents .

The predicted configuration file mainly configures three parts :
- The above section is to configure the initiator and participant roles
- The middle part needs to be filled with the correct Model information
- The following is the data table used in the forecast
The only thing that needs to be modified is the middle one Model information part ; Note that the version number entered here is Model deployment Version number returned after , And need to add job_type by predict Specify the task type as forecast task .
5、 ... and 、 Perform forecast task
Execute the following command :
flow job submit -c hetero_lr_normal_predict_conf.json
Just like model training, it also uses submit command , adopt -c Specify profile .
Return after successful execution :
{
"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"
}
6、 ... and 、 View forecast results
Can be returned by board_url perhaps job_id Go to FATE Board View results in , But the graphical interface can only be viewed at most 100 Bar record ;
We can go through output-data command , Export all data output of the specified component :
flow tracking output-data -j 202205070731385067720 -r guest -p 9999 -cpn hetero_lr_0 -o /data/projects/fate/examples/my_test/predict
- -j: Specify the... Of the forecast task job_id
- -cpn: Specify the component name .
- -o: Specify the output directory .
Return after successful execution :
{
"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"
}
In the catalog /data/projects/fate/examples/my_test/predict/job_202205070731385067720_hetero_lr_0_guest_9999_output_data You can see two files in :
- data.csv: For all data output .
- data.meta: Is the column header of the data .
Code scanning, attention, surprise !

边栏推荐
- 3. caller service call - dapr
- The hidden crisis of Weilai: past, present and future
- Experiment 6 8255 parallel interface experiment [microcomputer principle] [experiment]
- 云杉网络DeepFlow帮助5G核心网和电信云构建可观测性
- 隐私计算 FATE - 离线预测
- Oracle11g数据库使用expdp每周进行数据备份并上传到备份服务器
- With 120billion yuan, she will ring the bell for IPO again
- R language ggplot2 visualization: the patchwork package horizontally combines a ggplot2 visualization result and a plot function visualization result to form a final result graph, aligns the two visua
- Li Kou today's question -522 Longest special sequence
- 从五大能力到 “1+5+N”,华为让政企转型更稳健
猜你喜欢

Not being a meta universe now is like not buying a house 20 years ago!

Facebook出手!自适应梯度打败人工调参

SAP mts/ato/mto/eto topic 9: front and back desk operation in m+m mode, strategy 50, preparation of raw materials and semi-finished products in advance

Express模板引擎
MySQL主从切换的超详细步骤

What! 一条命令搞定监控?

美国乔布斯,殁了;中国乔布斯,卖了

MIPS assembly language learning -02- logic judgment - foreground input

MongoDB 在腾讯零售优码中的应用
Technical trendsetter
随机推荐
How can I get the stock account opening discount link? Is it safe to open a mobile account?
Complete model training routine (I)
openGauss内核:SQL解析过程分析
坐拥1200亿,她又要IPO敲钟了
Technical trendsetter
Fleet |「后台探秘」第 3 期:状态管理
ROS知识点——使用VScode搭建ROS开发环境
华为能成“口红一哥”,或者“带货女王”吗?
Jackie Chan and fast brand, who is the Savior of Kwai?
实验6 8255并行接口实验【微机原理】【实验】
最长连续序列
力扣今日题-522. 最长特殊序列
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一段文本内容横向组合起来形成最终结果图
智慧园区数智化供应链管理平台如何优化流程管理,驱动园区发展提速增质?
第四大运营商,难成「鲶鱼」
Curve 替换 Ceph 在网易云音乐的实践
一文教你快速生成MySQL数据库关系图
ROS knowledge points - definition and use of topic messages
PostgreSQL实现按年、月、日、周、时、分、秒的分组统计
[C language] implementation of binary tree and three Traversals