Skip to content

Commit

Permalink
Update ml_cov_search.R
Browse files Browse the repository at this point in the history
reset the seed on line 99 (back to the default seed = 123) at the beginning of each loop
  • Loading branch information
certara-irebai authored Sep 27, 2024
1 parent 443b8b4 commit f69c455
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/ml_cov_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ ml_cov_search <- function(data, pop_param, cov_continuous, cov_factors, seed = 1
format = "[:bar] :percent :elapsed elapsed / :eta remaining", total = length(pop_param) * 6, clear = FALSE, show_after = 0)
for (i in pop_param) {
set.seed(seed)
my_seed_name <- paste0("seed_", i)
assign(my_seed_name, .Random.seed, envir = .GlobalEnv)

pb$message(paste0("Searching covariate effects on ", i))
pb$tick()

Expand Down

1 comment on commit f69c455

@certara-mtalley
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@certara-irebai @certara-jcraig

I think we should remove this. These two lines were written just as a way to demonstrate that the seed has changed. It returns the current seed (in each iteration of the loop) to the users environment. Now that we have solved the seed issue (line 99, added in the previous commit), this is not needed.

Please sign in to comment.