Hi. I'm testing out this functionality for the first time - https://gurobi-machinelearning.readthedocs.io/en/stable/api/LinearRegressionConstr.html#module-gurobi_ml.sklearn.linear_regression
To try to simplify the problem, my LR model is trained on 3 features: [torque, water, days].
Water is a real optimization variable that I want to manipulate. Torque and Days are actually constant values I'm grabbing from a data sheet and plugging into the model. To do this, I defined the following variables and constraints.
water = model.addVar(vtype=GRB.INTEGER, name="Water", lb=0)
torque = model.addVar(vtype=GRB.INTEGER, name="Torque", lb=0)
days = model.addVar(vtype=GRB.INTEGER, name="Days", lb=0)
define_days= model.addConstr(days == 30)
define_torque = model.addConstr(torque == 1943.079429314926)
input_gurobi_var_feats = [torque, water, days]
output_gurobi_var = [pct_yield_ta]
lr_pred_constr = add_linear_regression_constr(gp_model= model,
My LR model is trained properly with the same number of features. My model failed with the ilp as follows. I have also attached the ilp, mlp, log, and sol files. Help on how to set this up would be greatly appreciated! I am on a bit of a time crunch to figure this out as well.
Please sign in to leave a comment.