diff --git a/src/gurobi_ml/modeling/decision_tree/decision_tree_model.py b/src/gurobi_ml/modeling/decision_tree/decision_tree_model.py index c8f1e7cb..70c41615 100644 --- a/src/gurobi_ml/modeling/decision_tree/decision_tree_model.py +++ b/src/gurobi_ml/modeling/decision_tree/decision_tree_model.py @@ -128,6 +128,8 @@ def _leaf_formulation( if verbose: timer.timing(f"Added {nex} linear constraints") + output.LB = np.maximum(output.LB, np.min(tree["value"])) + output.UB = np.minimum(output.UB, np.max(tree["value"])) def _paths_formulation(gp_model, _input, output, tree, epsilon, _name_var): @@ -207,8 +209,8 @@ def _paths_formulation(gp_model, _input, output, tree, epsilon, _name_var): for i in range(outdim) ) - output.LB = np.min(tree.value) - output.UB = np.max(tree.value) + output.LB = np.maximum(output.LB, np.min(tree["value"])) + output.UB = np.minimum(output.UB, np.max(tree["value"])) class AbstractTreeEstimator(AbstractPredictorConstr):