A user friendly way to create patient level prediction models using
the Observational Medical Outcomes Partnership Common Data Model. Given a cohort
of interest and an outcome of interest, the package can use data in the Common
Data Model to build a large set of features. These features can then be used to
fit a predictive model with a number of machine learning algorithms. This is
further described in Reps (2017)
PatientLevelPrediction is part of HADES.
PatientLevelPrediction is an R package for building and validating patient-level predictive models using data in the OMOP Common Data Model format.
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.
The figure below illustrates the prediction problem we address. Among a population at risk, we aim to predict which patients at a defined moment in time (t = 0) will experience some outcome during a time-at-risk. Prediction is done using only information about the patients in an observation window prior to that moment in time.

To define a prediction problem we have to define t=0 by a Target Cohort (T), the outcome we like to predict by an outcome cohort (O), and the time-at-risk (TAR). Furthermore, we have to make design choices for the model we like to develop, and determine the observational datasets to perform internal and external validation. This conceptual framework works for all type of prediction problems, for example those presented below (T=green, O=red).

|
|
| Calibration Plot | ROC Plot |
PatientLevelPrediction is an R package, with some functions using python through reticulate.
Requires R (version 4.1 or higher). Installation on Windows requires RTools. Some optional functionality requires Java or Python.
Some machine learning algorithms require Python. Reticulate will manage Python automatically using uv (https://docs.astral.sh/uv/getting-started/). If you're in an offline environment you can manage Python in any way you want and set the RETICULATE_PYTHON environment variable to the Python binary. The Python environment must include the packages needed by the selected model, including scikit-learn.
To install the package please read the Package Installation guide
Have a look at the video below for an extensive demo of the package.
Please read the main vignette for the package:
In addition we have created vignettes that describe advanced functionality in more detail:
Package function reference: Reference
Documentation can be found on the package website.
Read here how you can contribute to this package.
PatientLevelPrediction is licensed under Apache License 2.0
PatientLevelPrediction is being developed in R Studio.