Skip to main content

gurobi+ML

Answered

Comments

4 comments

  • 崇林 潘
    Conversationalist
    First Question

    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
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi,

    Check out the surrogate modelling example from the gurobi-machinelearning documentation:

    https://gurobi-machinelearning.readthedocs.io/en/stable/auto_examples/example1_2DPeakFunction.html#sphx-glr-auto-examples-example1-2dpeakfunction-py

    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
  • 崇林 潘
    Conversationalist
    First Question

    How to get Pareto Frontier in Gurobi for multiple goals, thanks

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    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.