Skip to content

Commit bb2738c

Browse files
committed
fix: adding solID for fixed hyps usecase
1 parent 7928583 commit bb2738c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

R/R/model.R

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,16 +276,11 @@ robyn_train <- function(InputCollect, hyper_collect,
276276
OutputModels[[1]]$resultCollect$resultHypParam <- arrange(
277277
OutputModels[[1]]$resultCollect$resultHypParam, .data$iterPar
278278
)
279-
dt_IDs <- data.frame(
280-
solID = dt_hyper_fixed$solID,
281-
iterPar = OutputModels[[1]]$resultCollect$resultHypParam$iterPar
282-
)
283279
these <- c("resultHypParam", "xDecompAgg", "xDecompVec", "decompSpendDist")
284280
for (tab in these) {
285-
OutputModels[[1]]$resultCollect[[tab]] <- left_join(
286-
OutputModels[[1]]$resultCollect[[tab]], dt_IDs,
287-
by = "iterPar"
288-
)
281+
if (!"solID" %in% colnames(OutputModels[[1]]$resultCollect[[tab]])) {
282+
OutputModels[[1]]$resultCollect[[tab]]$solID <- dt_hyper_fixed$solID
283+
}
289284
}
290285
} else {
291286
## Run robyn_mmm() for each trial if hyperparameters are not all fixed

0 commit comments

Comments
 (0)