gurobi+ML
AnsweredIf I use scikit-learn to create a model for prediction, such as RF,how can I use this model as a black box target function for another multi-objective optimization problem as one of its target functions?
-
Let me explain again. For example, I used scikit-learn to establish a prediction model. At the same time, I am now facing a multi-objective optimization problem. One of the goals is the smallest value of the prediction model to be established, and the other goal is to find a maximum value. How can I solve the established prediction model as one of the multi-objective problem target functions?
0 -
Hi,
Check out the surrogate modelling example from the gurobi-machinelearning documentation:
This example shows the result of a ML model being minimized.
Also see multiobj.py where we demonstrate the construction of a multi-objective model in Python. We also have a relevant section in our reference manual: Working with Multiple Objectives.
You can combine both approaches to achieve what you want. For example, try replacing
m.setObjective(y_approx, gp.GRB.MINIMIZE)
in the surrogate modelling example with
m.ModelSense = gp.GRB.MINIMIZE
m.setObjectiveN(y_approx, index=0, priority=1)
m.setObjectiveN(x.sum(), index=1, priority=0)- Riley
0 -
How to get Pareto Frontier in Gurobi for multiple goals, thanks
0 -
You will need to use the weight parameter in setObjectiveN, and use a blended objective (not hierarchical), i.e. set priority=0 for both objectives.
By varying the relative weights of the objectives you can obtain solutions along the pareto frontier.
- Riley
0
Please sign in to leave a comment.
Comments
4 comments