当前位置:网站首页>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_test
Under 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 !
边栏推荐
- Case driven: a detailed guide from getting started to mastering shell programming
- High "green premium" of environmental protection products? How far is the low-carbon lifestyle from people
- 324. swinging sort II: not a simple construction problem
- 浪潮网络步步为赢
- 化学制品制造业智慧供应商管理系统深度挖掘供应商管理领域,提升供应链协同
- spark sql 生成 json
- What! 一条命令搞定监控?
- Complete model training routine (I)
- [JS] Fibonacci sequence implementation (recursion and loop)
- 买卖股票的最佳时机
猜你喜欢
实验6 8255并行接口实验【微机原理】【实验】
MIPS汇编语言学习-01-两数求和以及环境配置、如何运行
New offline retail stores take off against the trend, and consumption enthusiasm under the dark cloud of inflation
Experiment 6 8255 parallel interface experiment [microcomputer principle] [experiment]
go-zero 微服务实战系列(七、请求量这么高该如何优化)
MIPS assembly language learning-03-cycle
How to build a 100000 level QPS large flow and high concurrency coupon system from zero
How can the digital intelligent supply chain management platform of the smart Park optimize process management and drive the development of the park to increase speed and quality?
成龙和快品牌,谁才是快手的救星?
隆重推出 Qodana:您最爱的 CI 的代码质量平台
随机推荐
halcon 基础总结(一)裁切图片并旋转图像
MongoDB 在腾讯零售优码中的应用
R language ggplot2 visualization: use the patchwork package to horizontally form two ggplot2 visualization results into a new result visualization combination diagram (using the | symbol)
Seata数据库中出现以下问题要怎么解决啊?
web Worker 轮询请求
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一段文本内容横向组合起来形成最终结果图
Facebook出手!自适应梯度打败人工调参
张同学还没学会当主播
How can the digital intelligent supply chain management platform of the smart Park optimize process management and drive the development of the park to increase speed and quality?
How does Seata server 1.5.0 support mysql8.0?
How to build a 100000 level QPS large flow and high concurrency coupon system from zero
The latest pycharm activation cracking code in 2022 is permanent_ Detailed installation tutorial (applicable to multiple versions)
R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果横向构成新的结果可视化组合图(使用|符号)
How to solve the following problems in the Seata database?
[spatial & single cellomics] phase 1: Study on PDAC tumor microenvironment by single cell binding spatial transcriptome
Complete model training routine (I)
MIPS assembly language learning -02- logic judgment - foreground input
蔚来潜藏的危机:过去、现在到未来
C语言学习-20-归并排序
论文解读(GCC)《Efficient Graph Convolution for Joint Node RepresentationLearning and Clustering》