add_linear_regression_constr#
- gurobi_ml.sklearn.linear_regression.add_linear_regression_constr(gp_model, linear_regression, input_vars, output_vars=None, **kwargs)#
Formulate linear_regression in gp_model.
The formulation predicts the values of output_vars using input_vars according to linear_regression. 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.
linear_regression (
sklearn.linear_model.LinearRegression
) –- The linear regression to insert. It can be of any of the following types:
- input_vars: mvar_array_like
Decision variables used as input for random forest in model.
- output_vars: mvar_array_like, optional
Decision variables used as output for random forest in model.
- Returns:
Object containing information about what was added to gp_model to formulate linear_regression.
- Return type:
Notes
See
add_predictor_constr
for acceptable values for input_vars and output_vars