gurobi_ml.sklearn.random_forest_regressor.add_random_forest_regressor_constr(gp_model, random_forest_regressor, input_vars, output_vars=None, **kwargs)#

Formulate random_forest_regressor in gp_model.

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

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

  • random_forest_regressor (sklearn.ensemble.RandomForestRegressor) – The random forest regressor to insert as predictor.

  • input_vars (mvar_array_like) – Decision variables used as input for random forest in model.

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


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

Return type:



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.