当前位置:网站首页>Privacy computing fat offline prediction
Privacy computing fat offline prediction
2022-06-27 13:59:00 【qq_ forty-three million four hundred and seventy-nine thousand 】
High quality resource sharing
| Learning route guidance ( Click unlock ) | Knowledge orientation | Crowd positioning |
|---|---|---|
| 🧡 Python Actual wechat ordering applet 🧡 | Progressive class | This course is python flask+ Perfect combination of wechat applet , From the deployment of Tencent to the launch of the project , Create a full stack ordering system . |
| Python Quantitative trading practice | beginner | Take you hand in hand to create an easy to expand 、 More secure 、 More efficient quantitative trading system |

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 !

边栏推荐
- After the deployment is created, the pod problem handling cannot be created
- 外部存储器
- Too many requests at once, and the database is in danger
- CCID Consulting released the database Market Research Report on key application fields during the "14th five year plan" (attached with download)
- 每日3题(1):找到最近的有相同 X 或 Y 坐标的点
- 【业务安全-04】万能用户名及万能密码实验
- [weekly replay] the 81st biweekly match of leetcode
- A statistical problem of shell script
- 为什么 Oracle 云客户必须在Oracle Cloud 季度更新发布后自行测试?
- How to use 200 lines of code to implement Scala's Object Converter
猜你喜欢
随机推荐
图书管理系统
NLP - monocleaner
国产数据库乱象
How to set the compatibility mode of 360 speed browser
命令行编辑器 sed 基础用法总结
What is the difference between the FAT32 and NTFS formats on the USB flash disk
ensp云朵配置
同花顺能开户炒股吗?安全吗?
Kyndryl与Oracle和Veritas达成合作
Implementing springboard agent through SSH port forwarding configuration
Why must Oracle cloud customers self test after the release of Oracle cloud quarterly update?
AGCO AI frontier promotion (6.27)
Getting to know cloud native security for the first time: the best guarantee in the cloud Era
scrapy
【微服务|Sentinel】热点规则|授权规则|集群流控|机器列表
A statistical problem of shell script
Prometheus 2.26.0 new features
芯片供给过剩之际,进口最多的中国继续减少进口,美国芯片慌了
[安洵杯 2019]Attack
打印输出数(递归方法解决)








