add_xgbregressor_constr#

gurobi_ml.xgboost.xgboost_regressor.add_xgbregressor_constr(gp_model, xgboost_regressor, input_vars, output_vars=None, epsilon=0.0, **kwargs)#

Formulate xgboost_regressor into gp_model.

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

This version is for using directly with the Scikit-Learn wrapper of XGBoost. Note that only “gbtree” regressors are supported at this point.

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

  • xgboost_regressor (xgboost.XGBRFRegressor) – The gradient boosting regressor to insert as predictor.

  • input_vars (mvar_array_like) – Decision variables used as input for gradient boosting regressor in model.

  • output_vars (mvar_array_like, optional) – Decision variables used as output for gradient boosting regressor in model.

Returns:

Object containing information about what was added to gp_model to formulate gradient_boosting_regressor.

Return type:

XGBoostRegressorConstr

Notes

See add_predictor_constr for acceptable values for input_vars and output_vars

Also see gurobi_ml.sklearn.decision_tree_regressor.add_decision_tree_regressor() for specific parameters to model decision tree estimators.

Raises:

NoModel – If the booster is not of type “gbtree”.