Skip to content

Commit 10495b9

Browse files
committed
fix: removed setorder apllied to local optim df which caused reproducibility-issues
1 parent 30bf97f commit 10495b9

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

R/getNextParameters.R

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#' @importFrom dbscan dbscan
2-
#' @importFrom data.table fintersect uniqueN setorder
2+
#' @importFrom data.table fintersect uniqueN .SD
33
getNextParameters <- function(
44
LocalOptims
55
, boundsDT
@@ -15,23 +15,21 @@ getNextParameters <- function(
1515
) {
1616

1717
LocalOptims <- LocalOptims[get("relUtility") >= acqThresh,]
18-
LocalOptims <- LocalOptims[,c(boundsDT$N,"gpUtility"),with=FALSE]
19-
20-
# using only one criteria to sort leads to not reproducible order
21-
setorder(
22-
LocalOptims,
23-
cols = c("gpUtility", "Score", "inBounds"),
24-
order = c(-1, -1, -1)
25-
)
18+
LocalOptims <- LocalOptims[
19+
,
20+
.SD,
21+
.SDcols = c(boundsDT$N,"gpUtility")
22+
]
23+
2624
LocalOptims$acqOptimum <- TRUE
2725

2826
# Mark clusters as duplicates if they have already been attempted. Note that
2927
# parameters must match exactly. Whether or not we should eliminate 'close'
3028
# parameters is experimental, and could cause problems as the parameter space
3129
# becomes more fully explored.
3230
LocalOptims$Duplicate <- checkDup(
33-
LocalOptims[,boundsDT$N,with=FALSE]
34-
, scoreSummary[,boundsDT$N,with=FALSE]
31+
LocalOptims[, boundsDT$N, with = FALSE]
32+
, scoreSummary[, boundsDT$N, with = FALSE]
3533
)
3634

3735
# If we already have runNew non-duplicate local optims, use the best of those.

0 commit comments

Comments
 (0)