add_pipeline_constr#

gurobi_ml.sklearn.pipeline.add_pipeline_constr(gp_model, pipeline, input_vars, output_vars=None, **kwargs)#

Formulate pipeline into gp_model.

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

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

  • pipeline (sklearn.pipeline.Pipeline) – The pipeline to insert as predictor.

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

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

Returns:

Object containing information about what was added to gp_model to embed the predictor into it

Return type:

PipelineConstr

Raises:

NoModel – If the translation to Gurobi of one of the elements in the pipeline is not implemented or recognized.

Notes

See add_predictor_constr for acceptable values for input_vars and output_vars