Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
Signed-off-by: cwj <talkingwallace@sohu.com>
  • Loading branch information
talkingwallace committed Sep 12, 2023
1 parent d8ee142 commit 15b2c6e
Show file tree
Hide file tree
Showing 9 changed files with 368 additions and 10 deletions.
139 changes: 139 additions & 0 deletions examples/benchmark_quality/hetero_sbt/hetero_sbt_benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
data:
- file: "examples/data/breast_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
label_type: int64
label_name: y
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: breast_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/breast_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: breast_hetero_host
namespace: experiment
role: host_0
- file: "examples/data/default_credit_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
label_type: int64
label_name: y
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: default_credit_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/default_credit_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: default_credit_hetero_host
namespace: experiment
role: host_0
- file: "examples/data/student_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
label_type: float64
label_name: y
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
head: true
partitions: 4
extend_sid: true
table_name: student_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/student_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
head: true
partition: 4
extend_sid: true
table_name: student_hetero_host
namespace: experiment
role: host_0
hetero_sbt-binary-0-breast:
local:
script: "./xgb.py"
conf: "./breast_lr_sklearn_config.yaml"
FATE-hetero-sbt:
script: "./pipeline-hetero-sbt.py"
conf: "./breast_config.yaml"
compare_setting:
relative_tol: 0.01
hetero_sbt-binary-1-default-credit:
local:
script: "./xgb.py"
conf: "./default_credit_lr_sklearn_config.yaml"
FATE-hetero-sbt:
script: "./pipeline-hetero-sbt.py"
conf: "./default_credit_config.yaml"
compare_setting:
relative_tol: 0.01
hetero_sbt-binary-2-epsilon-5k:
local:
script: "./xgb.py"
conf: "./epsilon_5k_lr_sklearn_config.yaml"
FATE-hetero-sbt:
script: "./pipeline-hetero-sbt.py"
conf: "./epsilon_5k_config.yaml"
compare_setting:
relative_tol: 0.01
hetero_sbt-binary-regression:
local:
script: "./xgb.py"
conf: "./give_credit_lr_sklearn_config.yaml"
FATE-hetero-sbt:
script: "./pipeline-hetero-sbt.py"
conf: "./give_credit_config.yaml"
compare_setting:
relative_tol: 0.01
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ idx: "id"
label_name: "y"
in_feat: 18
out_feat: 8
lr: 0.01
lr: 0.1
batch_size: 32
epochs: 100
class_num: 4
216 changes: 216 additions & 0 deletions examples/benchmark_quality/homo_nn/homo_nn_benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
data:
- file: "examples/data/breast_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
label_type: int64
label_name: y
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: breast_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/breast_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: breast_hetero_host
namespace: experiment
role: host_0
- file: "examples/data/default_credit_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
label_type: int64
label_name: y
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: default_credit_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/default_credit_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: default_credit_hetero_host
namespace: experiment
role: host_0
- file: "examples/data/give_credit_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
label_type: int64
label_name: y
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
partitions: 4
head: true
extend_sid: true
table_name: give_credit_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/give_credit_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
head: true
partitions: 4
extend_sid: true
table_name: give_credit_hetero_host
namespace: experiment
role: host_0
- file: "examples/data/vehicle_scale_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
label_type: int64
label_name: y
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
head: true
partitions: 4
extend_sid: true
table_name: vehicle_scale_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/vehicle_scale_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
head: true
partition: 4
extend_sid: true
table_name: vehicle_scale_hetero_host
namespace: experiment
role: host_0
- file: "examples/data/student_hetero_guest.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
label_type: float64
label_name: y
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
head: true
partitions: 4
extend_sid: true
table_name: student_hetero_guest
namespace: experiment
role: guest_0
- file: "examples/data/student_hetero_host.csv"
meta:
delimiter: ","
dtype: float64
input_format: dense
match_id_name: "id"
match_id_range: 0
tag_value_delimiter: ":"
tag_with_value: false
weight_type: float64
head: true
partition: 4
extend_sid: true
table_name: student_hetero_host
namespace: experiment
role: host_0
homo_nn-binary-0-breast:
local:
script: "./local_nn_binary.py"
conf: "./local_nn_breast_config.yaml"
FATE-homo-nn:
script: "./pipeline_nn_binary.py"
conf: "./fed_nn_breast_config.yaml"
compare_setting:
relative_tol: 0.01
# homo_nn-binary-1-default-credit:
# local:
# script: "./local_nn_binary.py"
# conf: "./local_nn_default_credit_config.yaml"
# FATE-homo-nn:
# script: "./pipeline_nn_binary.py"
# conf: "./fed_nn_default_credit_config.yaml"
# compare_setting:
# relative_tol: 0.01
# homo_nn-binary-2-give-credit:
# local:
# script: "./local_nn_binary.py"
# conf: "./local_nn_give_credit_config.yaml"
# FATE-homo-nn:
# script: "./pipeline_nn_binary.py"
# conf: "./fed_nn_give_credit_config.yaml"
# compare_setting:
# relative_tol: 0.01
homo_nn-regression-student:
local:
script: "./local_nn_regression.py"
conf: "./local_nn_student_config.yaml"
FATE-homo-nn:
script: "./pipeline_nn_regression.py"
conf: "./fed_nn_student_config.yaml"
compare_setting:
relative_tol: 0.05
homo_nn-multi-vehicle:
local:
script: "./local_nn_multi.py"
conf: "./local_nn_vehicle_config.yaml"
FATE-homo-nn:
script: "./pipeline_nn_multi.py"
conf: "./fed_nn_vehicle_config.yaml"
compare_setting:
relative_tol: 0.01
2 changes: 2 additions & 0 deletions examples/benchmark_quality/homo_nn/local_nn_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def main(config="../../config.yaml", param="./local_nn_breast_config.yaml", name
auc_train = roc_auc_score(y.numpy(), y_train_pred)
print('auc is {}'.format(auc_train))

return {}, {'auc': auc_train}

if __name__ == "__main__":
parser = argparse.ArgumentParser("BENCHMARK-QUALITY PIPELINE JOB")
parser.add_argument("-c", "--config", type=str,
Expand Down
6 changes: 6 additions & 0 deletions examples/benchmark_quality/homo_nn/local_nn_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ def main(config="../../config.yaml", param="", namespace=""):
recall = MultiRecall()(y_train_pred, y)
print(f"recall: {recall}")

result = {"multi_accuracy": acc,
"multi_precision": precision,
"multi_recall": recall}

return {}, result

if __name__ == "__main__":
parser = argparse.ArgumentParser("BENCHMARK-QUALITY PIPELINE JOB")
parser.add_argument("-c", "--config", type=str,
Expand Down
Loading

0 comments on commit 15b2c6e

Please sign in to comment.