AnotherSamWilson / ParBayesianOptimization

Parallelizable Bayesian Optimization in R
107 stars 18 forks source link

Migrating old ParBayesianOptimization code #37

Closed davehah closed 3 years ago

davehah commented 3 years ago

Upon my recent upgrade to R 4.0.5 from R 3.6.3, I also updated the ParBayesianOptimization package, which included the major upgrades (v0.1.2 to v1.2.4). However, while converting the code from the old syntax to the new one, I noticed that my code is actually taking longer to execute while converging to a lower Score. I believe I am not getting the new syntax to match my old one. Here is the following code for the old version:

Bmodel <- BayesianOptimization(
      FUN = rf_model,
      bounds = list(
        ntree = c(50L,300L),
        mtry = c(1L, 15L)
      ),
      initPoints = 12,  
      bulkNew = 6, 
      nIters = 18,  
      acq = "ei", kern="Matern52", kappa = 2.576, eps = 0.0, verbose = TRUE,
      parallel = TRUE,
      export=exp, packages=pac
    )

Here is the new one:

Bmodel <- bayesOpt(
        FUN = rf_model,
        bounds = list(
          ntree = c(50L,300L),
          mtry = c(1L, 15L)
        ),
        initPoints = 12,
        iters.k = 6,
        iters.n = 18,
        acq = "ei", kappa = 2.576, eps = 0.0, verbose = TRUE,
        parallel = TRUE

Could you spot where I am doing wrong here? Thank you.

samFarrellDay commented 3 years ago

I don't see anything different about your code - situations like this can be hard to diagnose because each situation can be so different. About how much longer is this running? If it's taking ~<10% longer then I am tempted to attribute it to random seeds, since random forests training time is pretty much linear with the ntree and mtry parameters.