Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_left_node(obj,derived_col_names):
nd = pml.Node()
nd.set_SimplePredicate(
pml.SimplePredicate(field=xgboostToPmml.replace_name_with_derivedColumnNames(derived_col_names[int(obj['split_feature'])],\
derived_col_names), operator=SIMPLE_PREDICATE_OPERATOR.LESS_OR_EQUAL.value, value="{:.16f}".format(obj['threshold'])))
create_node(obj['left_child'], nd, derived_col_names)
return nd
def create_right_node(obj,derived_col_names):
nd = pml.Node()
nd.set_SimplePredicate(
pml.SimplePredicate(field=xgboostToPmml.replace_name_with_derivedColumnNames(derived_col_names[int(obj['split_feature'])],\
derived_col_names), operator=SIMPLE_PREDICATE_OPERATOR.GREATER_THAN.value, value="{:.16f}".format(obj['threshold'])))
create_node(obj['right_child'], nd, derived_col_names)
return nd