From 7a83ec3827555ac08fe5bbd5314ff7a1e5c8e81f Mon Sep 17 00:00:00 2001 From: TRAN QUANG HUYEN <48154203+Tqhuyen@users.noreply.github.com> Date: Mon, 20 Feb 2023 15:37:50 +0700 Subject: [PATCH] Update h1st-graph.rst.txt --- docs/source/tutorials/quick-start/h1st-graph.rst.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/tutorials/quick-start/h1st-graph.rst.txt b/docs/source/tutorials/quick-start/h1st-graph.rst.txt index ba962f7d..61fb6a27 100644 --- a/docs/source/tutorials/quick-start/h1st-graph.rst.txt +++ b/docs/source/tutorials/quick-start/h1st-graph.rst.txt @@ -18,7 +18,7 @@ number. The Action HelloPrinter is only passed the even-number data where the model returned True. .. code-block:: python - + import h1st as h1 from h1st.model.model import Model from h1st.h1flow.h1step import Action @@ -26,7 +26,7 @@ model returned True. """ Simple rule-based model that "predicts" if a given value is an even number """ - def process(self, input_data: dict) -> dict: + def predict(self, input_data: dict) -> dict: predictions = [{'prediction': x % 2 == 0, 'value': x} for x in input_data["values"]] return {"predictions": predictions} @@ -51,7 +51,7 @@ The H1st graph itself is created by adding nodes incrementally. # In the first Node, the data is passed to the RuleBasedModel's "process" # method and a Decision is rendered from model output. - g.add(h1.Decision(RuleBasedModel(), + g.add(Decision(RuleBasedModel(), result_field="predictions", decision_field="prediction"))