From 5b581296d52acb3ec84ce684e0aa7e553e47a2af Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 18 Mar 2022 15:27:21 +0100 Subject: CART export: use .left/.right instead of .child.left/.child.right --- lib/functions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/functions.py b/lib/functions.py index bfe0b00..de5c722 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -521,15 +521,12 @@ class CARTFunction(SKLearnRegressionFunction): ] sub_data["paramDecisionValue"] = tree.threshold[node_id] sub_data["type"] = "scalarSplit" - sub_data["child"] = {} # child value if left_child != self.leaf_id: - sub_data["child"]["left"] = self.recurse_(tree, left_child, depth=depth + 1) + sub_data["left"] = self.recurse_(tree, left_child, depth=depth + 1) if right_child != self.leaf_id: - sub_data["child"]["right"] = self.recurse_( - tree, right_child, depth=depth + 1 - ) + sub_data["right"] = self.recurse_(tree, right_child, depth=depth + 1) return sub_data -- cgit v1.2.3