Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Setting of final.method and final.evals for multi-objective optimization not supported at the moment. #517

Open
swaheera opened this issue Jul 19, 2021 · 0 comments

Comments

@swaheera
Copy link

Hello Dr. Richter,

I ran the following code using your library

library(mlrMBO)

obj.fn = makeMultiObjectiveFunction(
    name = "My test function",
    fn = function(x1, x2, x3, x4) {
        var_1 <- sin(x1 + x2)
        var_2 <- cos(x1 - x2)
        var_3 <- x1 + x4
        var_4 <- x3 + x4 -7
        goal_1 = sum(var_1 + var_2 + var_3 + var_4)
        goal_2 = var_1 + var_2 - var_3 + var_4
        goal_3 = var_1 + var_2 - var_3 + 2*var_4
        
        return(c(goal_1, goal_2, goal_3))
        
    },
    n.objectives = 3L,
    #define acceptable ranges
    par.set = makeParamSet(
        makeNumericParam("x1", lower = 20, upper = 40),
        makeNumericParam("x2", lower = 30, upper = 45),
        makeNumericParam("x3", lower = 10, upper = 20),
        makeNumericParam("x4", lower = 10, upper = 50)
        #define constraints
        , forbidden = expression(x2 >x1 | x3 > x4)
    ),
    
    minimize=rep(TRUE,3)
)

#create control gird
control=makeMBOControl(propose.points=1, final.method="best.predicted",  n.objectives = 3L, final.evals=10)
control=setMBOControlTermination(control, iters=10)
control=setMBOControlInfill(control, crit=makeMBOInfillCritEI())

#perform optimization
lrn=makeMBOLearner(control, obj.fn)

res = mbo(obj.fn, design = NULL, learner = lrn, control = control, show.info = TRUE)

This produces the following error:

Error in checkStuff(fun, design, learner, control) : 
  Setting of final.method and final.evals for multi-objective optimization not supported at the moment.

Do you know why this is error is being produced? Is there a way to fix it?

Thank you so much for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant