Skip to content

Commit

Permalink
edit quick demo
Browse files Browse the repository at this point in the history
Signed-off-by: nemirorox <yolandawu131@gmail.com>
  • Loading branch information
nemirorox committed Nov 2, 2020
1 parent a43e67f commit 8e504f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions examples/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Below code shows how to build and fit a hetero SecureBoost model with FATE-Pipel

.. code-block:: python
import json
from pipeline.backend.config import Backend, WorkMode
from pipeline.backend.pipeline import PipeLine
from pipeline.component import Reader, DataIO, Intersection, HeteroSecureBoost, Evaluation
Expand Down Expand Up @@ -67,6 +68,14 @@ Below code shows how to build and fit a hetero SecureBoost model with FATE-Pipel
# compile & fit pipeline
pipeline.compile().fit(JobParameters(backend=Backend.EGGROLL, work_mode=WorkMode.STANDALONE))
# query component summary
print(f"Evaluation summary:\n{json.dumps(pipeline.get_component('evaluation_0').get_summary(), indent=4)}")
# Evaluation summary:
# {
# "auc": 0.9971790603033666,
# "ks": 0.9624094920987263
# }
Code for the above job can also be found `here <./pipeline/demo/pipeline-quick-demo.py>`_.

Expand Down
2 changes: 1 addition & 1 deletion examples/pipeline/demo/pipeline-quick-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
pipeline.compile().fit(JobParameters(backend=Backend.EGGROLL, work_mode=WorkMode.STANDALONE))

# query component summary
print(json.dumps(pipeline.get_component("evaluation_0").get_summary(), indent=4))
print(f"Evaluation summary:\n{json.dumps(pipeline.get_component('evaluation_0').get_summary(), indent=4)}")

0 comments on commit 8e504f8

Please sign in to comment.