Open scworland opened 7 years ago
Currently, the names of the initial grid data frame and the names of the bounds list have to be in the exact same order, otherwise there is an error. The issue is with the following code:
identical(names(init_grid_dt), c(DT_bounds[, Parameter], "Value"))
From the init_grid_dt loop:
## init_grid_dt setDT(init_grid_dt) if (nrow(init_grid_dt) != 0) { if (identical(names(init_grid_dt), DT_bounds[, Parameter]) == TRUE) { init_grid_dt[, Value := -Inf] } else if (identical(names(init_grid_dt), c(DT_bounds[, Parameter], "Value")) == TRUE) { paste(nrow(init_grid_dt), "points in hyperparameter space were pre-sampled\n", sep = " ") %>% cat(.) } else { stop("bounds and init_grid_dt should be compatible") } }
Unless I am missing something, wouldn't setequal accomplish the same thing and avoid the ordering issue?
setequal
one <- c("a","b") two <- c("b","a") identical(one,two) [1] FALSE setequal(one,two) [2] TRUE
Currently, the names of the initial grid data frame and the names of the bounds list have to be in the exact same order, otherwise there is an error. The issue is with the following code:
From the init_grid_dt loop:
Unless I am missing something, wouldn't
setequal
accomplish the same thing and avoid the ordering issue?