File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -449,16 +449,17 @@ def decision_rule(self, node_id):
449449 else :
450450 rule_dict .update ({key :{"right" : parent_node ["threshold" ]}})
451451 else :
452- if "left" not in rule_dict [key ].keys ():
453- rule_dict [key ].update ({"left" : parent_node ["threshold" ]})
454- else :
455- rule_dict [key ].update ({"left" : min (parent_node ["threshold" ], rule_dict [key ]["left" ])})
456- if "right" not in rule_dict [key ].keys ():
457- rule_dict [key ].update ({"right" : parent_node ["threshold" ]})
452+ if current_node ["is_left" ]:
453+ if "left" not in rule_dict [key ].keys ():
454+ rule_dict [key ].update ({"left" : parent_node ["threshold" ]})
455+ else :
456+ rule_dict [key ].update ({"left" : min (parent_node ["threshold" ], rule_dict [key ]["left" ])})
458457 else :
459- rule_dict [key ].update ({"right" : max (parent_node ["threshold" ], rule_dict [key ]["right" ])})
458+ if "right" not in rule_dict [key ].keys ():
459+ rule_dict [key ].update ({"right" : parent_node ["threshold" ]})
460+ else :
461+ rule_dict [key ].update ({"right" : max (parent_node ["threshold" ], rule_dict [key ]["right" ])})
460462 current_node = parent_node
461- print (rule_dict )
462463
463464 rule_list = []
464465 for key , item in rule_dict .items ():
You can’t perform that action at this time.
0 commit comments