Gradient Boosting Regressor Constraint

Module for formulating a sklearn.ensemble.GradientBoostingRegressor or a sklearn.ensemble.GradientBoostingClassifier into a PySCIPOpt Model.

pyscipopt_ml.sklearn.add_gradient_boosting_regressor_constr(scip_model, gradient_boosting_regressor, input_vars, output_vars=None, unique_naming_prefix='', **kwargs)

Formulate gradient_boosting_regressor into scip_model.

The formulation predicts the values of output_vars using input_vars according to gradient_boosting_regressor.

Parameters:
  • scip_model (PySCIPOpt Model) – The SCIP model where the predictor should be inserted.

  • gradient_boosting_regressor (sklearn.ensemble.GradientBoostingRegressor) – The gradient boosting regressor to insert as predictor.

  • input_vars (np.ndarray or list) – Decision variables used as input for gradient boosting regressor in model.

  • output_vars (np.ndarray or list, optional) – Decision variables used as output for gradient boosting regressor in model.

  • unique_naming_prefix (str, optional) – A unique naming prefix that is used before all variable and constraint names. This parameter is important if the SCIP model is later printed to file and many predictors are added to the same SCIP model.

Returns:

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

Return type:

GradientBoostingConstr

Note

See add_predictor_constr for acceptable values for input_vars and output_vars

pyscipopt_ml.sklearn.add_gradient_boosting_classifier_constr(scip_model, gradient_boosting_classifier, input_vars, output_vars=None, unique_naming_prefix='', **kwargs)

Formulate gradient_boosting_classifier into scip_model.

The formulation predicts the values of output_vars using input_vars according to gradient_boosting_classifier.

Parameters:
  • scip_model (PySCIPOpt Model) – The SCIP model where the predictor should be inserted.

  • gradient_boosting_classifier (sklearn.ensemble.GradientBoostingClassifier) – The gradient boosting classifier to insert as predictor.

  • input_vars (np.ndarray or list) – Decision variables used as input for gradient boosting classifier in model.

  • output_vars (np.ndarray or list, optional) – Decision variables used as output for gradient boosting classifier in model.

  • unique_naming_prefix (str, optional) – A unique naming prefix that is used before all variable and constraint names. This parameter is important if the SCIP model is later printed to file and many predictors are added to the same SCIP model.

Returns:

Object containing information about what was added to scip_model to formulate gradient_boosting_classifier.

Return type:

GradientBoostingConstr

Note

See add_predictor_constr for acceptable values for input_vars and output_vars

class pyscipopt_ml.sklearn.gradient_boosting.GradientBoostingConstr(scip_model, predictor, input_vars, output_vars, unique_naming_prefix, classification, **kwargs)

Class to model trained sklearn.ensemble.GradientBoostingRegressor with SCIP.

Stores the changes to the SCIP Model for representing an instance into it. Inherits from AbstractPredictorConstr.