一臀蛛、安裝conda,FATE框架下也有不同的python版本务热,安裝一個conda以方便python版本的管理
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
安裝到了 /root/miniconda3下
下載完成后涮坐,使用vim工具,編輯.bashrc文件
vim ~/.bashrc
在最后面添加
export PATH="/root/miniconda3/bin:"$PATH
輸入命令使.bashrc文件生效
source ~/.bashrc
查看conda命令如下表示成功
添加清華大學(xué)的鏡像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --set show_channel_urls yes
conda config --get channels
使用命令“conda create -n 環(huán)境名稱 python=版本號”創(chuàng)建環(huán)境
先創(chuàng)建一個fate3.6.7
查看環(huán)境列表 conda env list
激活環(huán)境 conda activate
退出環(huán)境
conda deactivate
二、FATE TEST
1硕并、下載fate-test
查看幫助列表
fate_test --help
2法焰、編輯默認(rèn)配置文件
使用系統(tǒng)默認(rèn)編輯器編輯優(yōu)先級配置文件
根據(jù)注釋填寫某些字段
fate_test_config.yaml
配置fate-pipeline 和fate-flow服務(wù)器設(shè)置
ip 127.0.0.1 port 9380
# configure FATE-Pipeline server setting
pipeline init --port 9380 --ip 127.0.0.1
# configure FATE-Flow Commandline server setting
flow init --port 9380 --ip 127.0.0.1
3、測試一下 fate_test 套件
fate_test suite -i <path contains *testsuite.json>
報錯:出現(xiàn)語法錯誤倔毙,應(yīng)該是編碼格式不對?
哦乙濒,群里老哥說這個<path contains testsuite.json>應(yīng)該是包含這個testsuite.json的路徑陕赃,例如找到一個
K均值聚類算法,嘗試著跑一下
報錯我的路徑有問題颁股? 看一下配置文件
在目錄 /root/miniconda3/envs/fate3.7/lib/python3.7/site-packages/fate_test下的fate_test_config.yaml文件中
查一下fate的存放數(shù)據(jù)的文件:
那就是替換掉/example*之前的路徑就行
用fate_test 執(zhí)行secureboost算法
‘’‘fate_test suite - i *’‘’
上傳數(shù)據(jù):
一直卡在數(shù)據(jù)上傳階段
換個算法試試
還是同樣的問題么库,上傳不了數(shù)據(jù)
看一下配置文件有沒有關(guān)于數(shù)據(jù)上傳的配置,發(fā)現(xiàn)沒有甘有,那我找一下數(shù)據(jù)存放的目錄
可以看到都是4月17號也就是前天上傳的測試數(shù)據(jù)诉儒,并沒有今天用fate_test工具所上傳的數(shù)據(jù),說明還是數(shù)據(jù)傳輸出了問題
看一下 fate board
可是顯示 submit job successfully 亏掀。忱反。。
去上面目錄找下這個.csv文件
也能找到這個數(shù)據(jù)集滤愕。温算。。
等了好久也沒解決间影,先做做下面的
4注竿、run some fate_test benchmark,也就是基準(zhǔn)測試魂贬,對比一下fate算法與其他算法的精度
fate_test benchmark-quality -i <path contains *benchmark.json>
還是一樣的問題巩割。。付燥⌒福卡在數(shù)據(jù)上傳就不動了
三、開發(fā)模式
1机蔗、使用可編輯模式蒲祈,先下載fate_client 和 fate_test
pip install -e ${FATE}/python/fate_client && pip install -e ${FATE}/python/fate_test
2、一些常用的命令
1>suite: used for running testsuites, collection of FATE jobs
用來進(jìn)行一些testsuites和jobs的測試
fate_test suite -i <path contains *testsuite.json>
<path contains *testsuite.json>指包含testsuite.json文件的絕對路徑
2>benchmark-quality used for comparing modeling quality between FATE and other machine learning systems
bq 用來比較fated 的算法模型和其他機(jī)器學(xué)習(xí)模型的好壞
fate_test bq -i <path contains *benchmark.json>
這個路徑在 /examples/benchmark_quality 文件夾下
3萝嘁、進(jìn)行配置
因為是進(jìn)行的單機(jī)部署梆掸,guest 和 host 是同一臺機(jī)器,所以不需要ssh隧道
9999, service: service_a
10000, service: service_b
得保證service_a 和 service_b能直接通信