Skip to content

Commit

Permalink
Fixing seeds and setting resetCoefficients = TRUE to ensure reprodu…
Browse files Browse the repository at this point in the history
…cibility of positive control synthesis.
  • Loading branch information
Schuemie authored and Schuemie committed Feb 10, 2022
1 parent 9e4e424 commit bee483d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MethodEvaluation
Type: Package
Title: Package for Evaluation of Estimation Methods
Version: 2.2.0
Version: 2.2.1
Date: 2022-01-21
Authors@R: c(
person("Martijn", "Schuemie", , "[email protected]", role = c("aut", "cre"))
Expand Down
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
MethodEvaluation 2.2.1
======================

Changes:

1. Fixing seeds and setting `resetCoefficients = TRUE` to ensure reproducibility of positive control synthesis.


MethodEvaluation 2.2.0
======================

Changes:

1. Updating from 'oracleTempSchema' to 'tempEmulationSchema' for newer versions of SqlRender.
1. Updating from `oracleTempSchema` to `tempEmulationSchema` for newer versions of SqlRender.

2. Added unit tests.

Expand Down
7 changes: 3 additions & 4 deletions R/PositiveControlSynthesis.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ synthesizePositiveControls <- function(connectionDetails,
prior = Cyclops::createPrior("laplace", exclude = 0, useCrossValidation = TRUE),
control = Cyclops::createControl(cvType = "auto",
startingVariance = 0.1,
seed = 1,
resetCoefficients = TRUE,
noiseLevel = "quiet",
threads = 10),
firstExposureOnly = FALSE,
Expand Down Expand Up @@ -795,6 +797,7 @@ generateOutcomes <- function(task,
task$exposureId,
" and outcome ",
task$outcomeId)
set.seed(1)
resultSubset <- result[result$exposureId == task$exposureId & result$outcomeId == task$outcomeId, ]
if (file.exists(file.path(task$modelFolder, "Error.txt"))) {
return(resultSubset)
Expand All @@ -812,10 +815,6 @@ generateOutcomes <- function(task,
covariateData <- FeatureExtraction::loadCovariateData(task$covarFileName)
covariates <- covariateData$covariates %>%
filter(.data$rowId %in% local(exposures$rowId))

# ffbase::load.ffdf(task$covarFileName)
# open(covariates, readOnly = TRUE)
# covariates <- covariates[ffbase::`%in%`(covariates$rowId, exposures$rowId), ]
}
prediction <- .predict(betas, exposures, covariates, modelType)
saveRDS(prediction, predictionFile)
Expand Down
4 changes: 2 additions & 2 deletions man/synthesizePositiveControls.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bee483d

Please sign in to comment.