Introduction

This vignette describes how you need to install the Observational Health Data Sciencs and Informatics (OHDSI) PatientLevelPrediction package under Windows, Mac, and Linux.

Software Prerequisites

Windows Users

Under Windows the OHDSI Patient Level Prediction (PLP) package requires installing:

Mac/Linux Users

Under Mac and Linux the OHDSI Patient Level Prediction (PLP) package requires installing:

Installing the Package

The preferred way to install the package is by using remotes, which will automatically install the latest release and all the latest dependencies.

If you do not want the official release you could install the bleading edge version of the package (latest develop branch).

Note that the latest develop branch could contain bugs, please report them to us if you experience problems.

Installing PatientLevelPrediction using remotes

To install using remotes run:

install.packages("remotes")
remotes::install_github("OHDSI/FeatureExtraction")
remotes::install_github("OHDSI/PatientLevelPrediction")

When installing make sure to close any other Rstudio sessions that are using PatientLevelPrediction or any dependency. Keeping Rstudio sessions open can cause locks that prevent the package installing.

Creating Python Reticulate Environment

Many of the classifiers in the PatientLevelPrediction use a Python back end. To set up a python environment run:

library(PatientLevelPrediction)
reticulate::install_miniconda()
configurePython(envname='r-reticulate', envtype='conda')

Some of the less frequently used classifiers are not installed during this set-up to add them run:

For GBM survival:

reticulate::conda_install(envname='r-reticulate', packages = c('scikit-survival'), forge = TRUE, pip = FALSE, pip_ignore_installed = TRUE, conda = "auto", channel = 'sebp')

Testing installation

To test whether the package is installed correctly, using the test script in '/extras', run:

# load the checkPlpInstallation function
library(devtools)
source_url('https://raw.github.com/OHDSI/PatientLevelPrediction/issue242/extras/checkPlpInstallation.R')

# set up the database connection details
library(DatabaseConnector)
connectionDetails <- createConnectionDetails(
  dbms = 'sql_server', 
  user = 'username', 
  password = 'hidden', 
  server = 'your server', 
  port = 'your port'
  )

# run the test
checkPlpInstallation(
  connectionDetails = connectionDetails, 
  python = T
  )

To test the installation (excluding python) run:

checkPlpInstallation(
  connectionDetails = connectionDetails, 
  python = F
  )

The check can take a while to run since it will build the following models in sequence on simulated data: Logistic Regression, RandomForest, MLP, AdaBoost, Decision Tree, Naive Bayes, KNN, Gradient Boosting. Moreover, it will test the database connection.

Installation issues

Installation issues need to be posted in our issue tracker: http://github.com/OHDSI/PatientLevelPrediction/issues

The list below provides solutions for some common issues:

  1. If you have an error when trying to install a package in R saying 'Dependancy X not available ...' then this can sometimes be fixed by running install.packages('X') and then once that completes trying to reinstall the package that had the error.

  2. I have found that using the github `remotes`` to install packages can be impacted if you have multiple R sessions open as one session with a library open can cause the library to be locked and this can prevent an install of a package that depends on that library.

Acknowledgments

Considerable work has been dedicated to provide the PatientLevelPrediction package.

citation("PatientLevelPrediction")

Please reference this paper if you use the PLP Package in your work:

Reps JM, Schuemie MJ, Suchard MA, Ryan PB, Rijnbeek PR. Design and implementation of a standardized framework to generate and evaluate patient-level prediction models using observational healthcare data. J Am Med Inform Assoc. 2018;25(8):969-975.

This work is supported in part through the National Science Foundation grant IIS 1251151.



quinterpriest/PatientLevelPrediction documentation built on April 20, 2022, 12:50 a.m.