Getting data and creating a study population

Functions for getting the necessary data from the database in Common Data Model, and creating a study population.

getPlpData()

Get the patient level prediction data from the server

savePlpData()

Save the cohort data to folder

loadPlpData()

Load the cohort data from a folder

createStudyPopulation()

Create a study population

Non-Temporal Feature Models

Functions for setting model that use non-temporal data and their hyper-parameter search.

setAdaBoost()

Create setting for AdaBoost with python

setDeepNN()

Create setting for DeepNN model

setDecisionTree()

Create setting for DecisionTree with python

setGradientBoostingMachine()

Create setting for gradient boosting machine model using gbm_xgboost implementation

setKNN()

Create setting for knn model

setLassoLogisticRegression()

Create setting for lasso logistic regression

setLRTorch()

Create setting for logistics regression model with python

setMLP()

Create setting for neural network model with python

setMLPTorch()

Create setting for neural network model with python

setNaiveBayes()

Create setting for naive bayes model with python

setRandomForest()

Create setting for random forest model with python (very fast)

Temporal Feature Models

Functions for setting model that use temporal data and their hyper-parameter search.

setCIReNN()

Create setting for CIReNN model

setCNNTorch()

Create setting for CNN model with python

setCovNN()

Create setting for multi-resolution CovNN model (stucture based on https://arxiv.org/pdf/1608.00647.pdf CNN1)

setRNNTorch()

Create setting for RNN model with python

Single Patient-Level Prediction Model

Functions for training/evaluating/applying a single patient-level-prediction model

runPlp()

runPlp - Train and evaluate the model

applyModel()

Apply train model on new data Apply a Patient Level Prediction model on Patient Level Prediction Data and get the predicted risk in [0,1] for each person in the population. If the user inputs a population with an outcomeCount column then the function also returns the evaluation of the prediction (AUC, brier score, calibration)

evaluatePlp()

evaluatePlp

savePlpModel()

Saves the plp model

loadPlpModel()

loads the plp model

savePlpResult()

Saves the result from runPlp into the location directory

loadPlpResult()

Loads the evalaution dataframe

Multiple Patient-Level Prediction Models

Functions for training mutliple patient-level-prediction model in an efficient way.

runPlpAnalyses()

Run a list of predictions

createPlpModelSettings()

create a an object specifying the multiple Plp model settings

combinePlpModelSettings()

combine two objects specifying multiple Plp model settings

createStudyPopulationSettings()

create the study population settings

evaluateMultiplePlp()

externally validate the multiple plp models across new datasets

savePredictionAnalysisList()

Saves a json prediction settings given R settings

loadPredictionAnalysisList()

Load the multiple prediction json settings from a file

Ensemble Model

Functions for creating an ensemble model

runEnsembleModel()

ensemble - Create an ensembling model using different models

applyEnsembleModel()

Apply trained ensemble model on new data Apply a Patient Level Prediction model on Patient Level Prediction Data and get the predicted risk in [0,1] for each person in the population. If the user inputs a population with an outcomeCount column then the function also returns the evaluation of the prediction (AUC, brier score, calibration)

saveEnsemblePlpModel()

saves the Ensmeble plp model

loadEnsemblePlpModel()

loads the Ensmeble plp model and return a model list

saveEnsemblePlpResult()

saves the Ensemble plp results

loadEnsemblePlpResult()

loads the Ensemble plp results

External validation

Functions for externally validating a model on new datasets

externalValidatePlp()

externalValidatePlp - Validate a model on new databases

Shiny Viewers

Functions for viewing results via a shiny app

viewPlp()

viewPlp - Interactively view the performance and model settings

viewMultiplePlp()

open a local shiny app for viewing the result of a multiple PLP analyses

Report Creation

Functions for creating documents

createPlpJournalDocument()

createPlpJournalDocument

createPlpReport()

createPlpReport

Plotting

Functions for various performance plots

plotPlp()

Plot all the PatientLevelPrediction plots

plotSparseRoc()

Plot the ROC curve using the sparse thresholdSummary data frame

plotSmoothCalibration()

Plot the smooth calibration as detailed in Calster et al. "A calibration heirarchy for risk models was defined: from utopia to empirical data" (2016)

plotSparseCalibration()

Plot the calibration

plotSparseCalibration2()

Plot the conventional calibration

plotDemographicSummary()

Plot the Observed vs. expected incidence, by age and gender

plotF1Measure()

Plot the F1 measure efficiency frontier using the sparse thresholdSummary data frame

plotGeneralizability()

Plot the train/test generalizability diagnostic

plotPrecisionRecall()

Plot the precision-recall curve using the sparse thresholdSummary data frame

plotPredictedPDF()

Plot the Predicted probability density function, showing prediction overlap between true and false cases

plotPreferencePDF()

Plot the preference score probability density function, showing prediction overlap between true and false cases #'

plotPredictionDistribution()

Plot the side-by-side boxplots of prediction distribution, by class#'

plotVariableScatterplot()

Plot the variable importance scatterplot

Learning Curves

Functions for creating and plotting learning curves

createLearningCurve()

createLearningCurve

createLearningCurvePar()

createLearningCurvePar

plotLearningCurve()

plotLearningCurve

Simulation

Functions for simulating cohort method data objects.

simulatePlpData()

Generate simulated data

Helper functions

Various helper functions

checkPlpInstallation()

Check PatientLevelPrediction and its dependencies are correctly installed