add_polynomial_features_constr#

gurobi_ml.sklearn.preprocessing.add_polynomial_features_constr(gp_model, polynomial_features, input_vars, **kwargs)#

Formulate polynomial_features into gp_model.

Note that this function creates the output variables from the input variables.

Parameters:
  • gp_model (gurobipy model) – The gurobipy model where polynomial features should be inserted.

  • polynomial_features (sklearn.preprocessing.PolynomialFeatures) – The polynomial features to insert in gp_model.

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

Returns:

Object containing information about what was added to gp_model to insert the polynomial_features in it

Return type:

sklearn.preprocessing.PolynomialFeaturesConstr

Warning

Only polynomial features of degree 2 are supported.