add_decision_tree_regressor_constr

gurobi_ml.sklearn.decision_tree_regressor.add_decision_tree_regressor_constr(gp_model, decision_tree_regressor, input_vars, output_vars=None, epsilon=0.0, **kwargs)

Formulate decision_tree_regressor into gp_model.

The formulation predicts the values of output_vars using input_vars according to decision_tree_regressor. See our User’s Guide for details on the mip formulation used.

Parameters:
  • gp_model (gurobipy model) – The gurobipy model where the predictor should be inserted.

  • decision_tree_regressor (sklearn.tree.DecisionTreeRegressor) – The decision tree regressor to insert as predictor.

  • input_vars (mvar_array_like) – Decision variables used as input for decision tree in model.

  • output_vars (mvar_array_like, optional) – Decision variables used as output for decision tree in model.

  • epsilon (float, optional) – Small value used to impose strict inequalities for splitting nodes in MIP formulations.

Returns:

Object containing information about what was added to gp_model to formulate decision_tree_regressor

Return type:

DecisionTreeRegressorConstr

Notes

See add_predictor_constr for acceptable values for input_vars and output_vars

Warning

Although decision trees with multiple outputs are tested they were never used in a non-trivial optimization model. It should be used with care at this point.