diagnosePlp {PatientLevelPrediction} | R Documentation |
diagnostic - Investigates the prediction problem settings - use before training a model
Description
This function runs a set of prediction diagnoses to help pick a suitable T, O, TAR and determine whether the prediction problem is worth executing.
Usage
diagnosePlp(
plpData = NULL,
outcomeId,
analysisId,
populationSettings,
splitSettings = createDefaultSplitSetting(),
sampleSettings = createSampleSettings(),
saveDirectory = NULL,
featureEngineeringSettings = createFeatureEngineeringSettings(),
modelSettings = setLassoLogisticRegression(),
logSettings = createLogSettings(verbosity = "DEBUG", timeStamp = TRUE, logName =
"diagnosePlp Log"),
preprocessSettings = createPreprocessSettings()
)
Arguments
plpData |
An object of type |
outcomeId |
(integer) The ID of the outcome. |
analysisId |
(integer) Identifier for the analysis. It is used to create, e.g., the result folder. Default is a timestamp. |
populationSettings |
An object of type |
splitSettings |
An object of type |
sampleSettings |
An object of type |
saveDirectory |
The path to the directory where the results will be saved (if NULL uses working directory) |
featureEngineeringSettings |
An object of |
modelSettings |
An object of class
|
logSettings |
An object of |
preprocessSettings |
An object of |
Details
Users can define set of Ts, Os, databases and population settings. A list of data.frames containing details such as follow-up time distribution, time-to-event information, characteriszation details, time from last prior event, observation time distribution.
Value
An object containing the model or location where the model is saved, the data selection settings, the preprocessing and training settings as well as various performance measures obtained by the model.
distribution
: List for each O of a data.frame containing: i) Time to observation end distribution, ii) Time from observation start distribution, iii) Time to event distribution and iv) Time from last prior event to index distribution (only for patients in T who have O before index)incident
: List for each O of incidence of O in T during TARcharacterization
: List for each O of Characterization of T, TnO, Tn~O
Examples
# load the data
plpData <- getEunomiaPlpData()
populationSettings <- createStudyPopulationSettings(minTimeAtRisk = 1)
saveDirectory <- file.path(tempdir(), "diagnosePlp")
diagnosis <- diagnosePlp(plpData = plpData, outcomeId = 3, analysisId = 1,
populationSettings = populationSettings, saveDirectory = saveDirectory)
# clean up
unlink(saveDirectory, recursive = TRUE)