Skip to content

Commit

Permalink
Develop (#61)
Browse files Browse the repository at this point in the history
Fix modelType bug
  • Loading branch information
egillax authored Mar 24, 2023
1 parent 207a860 commit 89dd41b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: DeepPatientLevelPrediction
Type: Package
Title: Deep Learning For Patient Level Prediction Using Data In The OMOP Common Data Model
Version: 1.1.1
Version: 1.1.2
Date: 15-12-2022
Authors@R: c(
person("Egill", "Fridgeirsson", email = "[email protected]", role = c("aut", "cre")),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DeepPatientLevelPrediction 1.1.1
DeepPatientLevelPrediction 1.1.2
======================
- Fix bug introduced by removing modelType from attributes (#59)

DeepPatientLevelPrediction 1.1
Expand Down
1 change: 0 additions & 1 deletion R/Estimator.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ fitEstimator <- function(trainData,
isNumeric = cvResult$numericalIndex
)

attr(modelSettings$param, 'settings')$modelType <- modelSettings$modelType
comp <- start - Sys.time()
result <- list(
model = cvResult$estimator, # file.path(outLoc),
Expand Down
2 changes: 2 additions & 0 deletions R/MLP.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ setMultiLayerPerceptron <- function(numLayers = c(1:8),
if (hyperParamSearch == "random") {
suppressWarnings(withr::with_seed(randomSampleSeed, {param <- param[sample(length(param), randomSample)]}))
}
attr(param, 'settings')$modelType <- "MLP"

results <- list(
fitFunction = "fitEstimator",
param = param,
Expand Down
2 changes: 1 addition & 1 deletion R/ResNet.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ setResNet <- function(numLayers = c(1:8),
if (hyperParamSearch == "random") {
suppressWarnings(withr::with_seed(randomSampleSeed, {param <- param[sample(length(param), randomSample)]}))
}

attr(param, 'settings')$modelType <- "ResNet"
results <- list(
fitFunction = "fitEstimator",
param = param,
Expand Down
2 changes: 1 addition & 1 deletion R/Transformer.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ setTransformer <- function(numBlocks = 3, dimToken = 96, dimOut = 1,
if (hyperParamSearch == "random") {
suppressWarnings(withr::with_seed(randomSampleSeed, {param <- param[sample(length(param), randomSample)]}))
}

attr(param, 'settings')$modelType <- "Transformer"
results <- list(
fitFunction = "fitEstimator",
param = param,
Expand Down

0 comments on commit 89dd41b

Please sign in to comment.