def node_to_string()

in src/ppxgboost/BoosterParser.py [0:0]


    def node_to_string(self, lvl):
        ans = ""
        for i in range(0, lvl):
            ans = ans + "\t"

        ans = "{}{}:[{}<{}] yes={},no={},missing={}\n".format(ans, str(self.id), str(self.feature_name),
                                                              str(self.cmp_val),
                                                              str(self.if_true_child.id), str(self.if_false_child.id),
                                                              str(self.default_child.id))

        return ans + self.if_true_child.node_to_string(lvl + 1) + self.if_false_child.node_to_string(lvl + 1)