Skip to content

Commit

Permalink
Release 2.0.2 (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax authored Dec 5, 2023
1 parent 8942e11 commit 4356057
Show file tree
Hide file tree
Showing 35 changed files with 1,533 additions and 1,148 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^extras$
^deploy.sh$
^compare_versions$
^.mypy_cache$
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ docs
.idea/
renv.lock
extras/
.Renviron
.Renviron
inst/python/__pycache__
.mypy_cache
6 changes: 3 additions & 3 deletions 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: 2.0.1
Version: 2.0.2
Date: 18-04-2023
Authors@R: c(
person("Egill", "Fridgeirsson", email = "[email protected]", role = c("aut", "cre")),
Expand Down Expand Up @@ -35,7 +35,8 @@ Suggests:
testthat,
PRROC,
ResultModelManager (>= 0.2.0),
DatabaseConnector (>= 6.0.0)
DatabaseConnector (>= 6.0.0),
Andromeda
Remotes:
ohdsi/PatientLevelPrediction,
ohdsi/FeatureExtraction,
Expand All @@ -51,7 +52,6 @@ Config/reticulate:
list(package = "polars"),
list(package = "tqdm"),
list(package = "connectorx"),
list(package = "scikit-learn"),
list(package = "pyarrow")
)
)
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by roxygen2: do not edit by hand

export(TrainingCache)
export(fitEstimator)
export(gridCvDeep)
export(predictDeepEstimator)
Expand All @@ -10,6 +9,7 @@ export(setEstimator)
export(setMultiLayerPerceptron)
export(setResNet)
export(setTransformer)
export(trainingCache)
importFrom(dplyr,"%>%")
importFrom(reticulate,py_to_r)
importFrom(reticulate,r_to_py)
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
DeepPatientLevelPrediction 2.0.2
======================
- Ensure output from predict_proba is numeric instead of 1d array
- Refactoring: Move cross-validation to a separate function
- Refactoring: Move paramsToTune to a separate function
- linting: Enforcing HADES style
- Calculate AUC ourselves with torch, get rid of scikit-learn dependancy
- added Andromeda to dev dependencies


DeepPatientLevelPrediction 2.0.1
======================
- Connection parameter fixed to be in line with newest polars
Expand Down
23 changes: 12 additions & 11 deletions R/Dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
createDataset <- function(data, labels, plpModel=NULL) {
createDataset <- function(data, labels, plpModel = NULL) {
path <- system.file("python", package = "DeepPatientLevelPrediction")
Dataset <- reticulate::import_from_path("Dataset", path = path)$Data
dataset <- reticulate::import_from_path("Dataset", path = path)$Data
if (is.null(attributes(data)$path)) {
# sqlite object
attributes(data)$path <- attributes(data)$dbname
}
if (is.null(plpModel)) {
data <- Dataset(r_to_py(normalizePath(attributes(data)$path)),
r_to_py(labels$outcomeCount))
data <- dataset(r_to_py(normalizePath(attributes(data)$path)),
r_to_py(labels$outcomeCount))
} else {
numericalFeatures <-
r_to_py(as.array(which(plpModel$covariateImportance$isNumeric)))
data <- dataset(r_to_py(normalizePath(attributes(data)$path)),
numerical_features = numericalFeatures)
}
else {
data <- Dataset(r_to_py(normalizePath(attributes(data)$path)),
numerical_features = r_to_py(as.array(which(plpModel$covariateImportance$isNumeric))) )
}

return(data)
}

return(data)
}
7 changes: 3 additions & 4 deletions R/DeepPatientLevelPrediction.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

#' DeepPatientLevelPrediction
#'
#' @description A package containing deep learning extensions for developing prediction models using data in the OMOP CDM
#' @description A package containing deep learning extensions for developing
#' prediction models using data in the OMOP CDM
#'
#' @docType package
#' @name DeepPatientLevelPrediction
Expand All @@ -28,9 +29,7 @@
NULL

.onLoad <- function(libname, pkgname) {
# use superassignment to update global reference
# use superassignment to update global reference
reticulate::configure_environment(pkgname)
torch <<- reticulate::import("torch", delay_load = TRUE)
}


Loading

0 comments on commit 4356057

Please sign in to comment.