add_mlp_regressor_constr#

gurobi_ml.sklearn.mlpregressor.add_mlp_regressor_constr(gp_model, mlp_regressor, input_vars, output_vars=None, **kwargs)#

Formulate mlp_regressor in gp_model.

The formulation predicts the values of output_vars using input_vars according to mlp_regressor. See our Users Guide for details on the mip formulation used.

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

  • mlpregressor (sklearn.neural_network.MLPRegressor) – The multi-layer perceptron regressor 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 formulate mlp_regressor.

Return type:

MLPRegressorConstr

Raises:

NoModel – If the translation to Gurobi of the activation function for the network is not implemented.

Notes

See add_predictor_constr for acceptable values for input_vars and output_vars