Skip to content

Commit

Permalink
Merge pull request #409 from OHDSI/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jreps authored Aug 16, 2023
2 parents f5942b6 + 39aabd1 commit f6bda23
Show file tree
Hide file tree
Showing 14 changed files with 588 additions and 41 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: PatientLevelPrediction
Type: Package
Title: Developing patient level prediction using data in the OMOP Common Data
Model
Version: 6.3.3
Date: 2023-05-15
Version: 6.3.4
Date: 2023-08-15
Authors@R: c(
person("Jenna", "Reps", email = "[email protected]", role = c("aut", "cre")),
person("Martijn", "Schuemie", role = c("aut")),
Expand Down Expand Up @@ -39,7 +39,7 @@ Imports:
polspline,
pROC,
PRROC,
reticulate (> 1.16),
reticulate (>= 1.30),
rlang,
SqlRender (>= 1.1.3),
survival,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export(createPreprocessSettings)
export(createRandomForestFeatureSelection)
export(createRestrictPlpDataSettings)
export(createSampleSettings)
export(createSplineSettings)
export(createStratifiedImputationSettings)
export(createStudyPopulation)
export(createStudyPopulationSettings)
export(createTempModelLoc)
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
PatientLevelPrediction 6.3.4
======================
- added spline feature engineering
- added age/sex stratified imputation feature engineering
- changed result table execution date types to varchar
- updated covariateSummary to use feature engineering

PatientLevelPrediction 6.3.3
======================
- fixed bug introduced with new reticulate update in model saving to json tests
Expand Down
22 changes: 22 additions & 0 deletions R/CovariateSummary.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,28 @@ covariateSummary <- function(
strata = strata
)

# apply feature engineering
if(!is.null(featureEngineering)){

# create copy of covariateData
newCovariateData <- Andromeda::andromeda(
covariateRef = covariateData$covariateRef,
analysisRef = covariateData$analysisRef,
covariates = covariateData$covariates
)
covariateData <- newCovariateData

if(!is.null(featureEngineering$funct)){
featureEngineering <- list(featureEngineering)
}

for(fe in featureEngineering){
feSettings <- fe$settings
feSettings$trainData = list(covariateData = covariateData)
covariateData <- do.call(fe$funct, feSettings)$covariateData
}
}

# make this run in parallel for big speed improvements..
covariateSummariesPerStrata <- lapply(subsetList,
function(x){
Expand Down
Loading

0 comments on commit f6bda23

Please sign in to comment.