View source: R/RunMultiplePlp.R
validateMultiplePlp | R Documentation |
This function loads all the models in a multiple plp analysis folder and validates the models on new data
validateMultiplePlp(
analysesLocation,
validationDatabaseDetails,
validationRestrictPlpDataSettings = createRestrictPlpDataSettings(),
recalibrate = NULL,
cohortDefinitions = NULL,
saveDirectory = NULL
)
analysesLocation |
The location where the multiple plp analyses are |
validationDatabaseDetails |
A single or list of validation database settings created using |
validationRestrictPlpDataSettings |
The settings specifying the extra restriction settings when extracting the data created using |
recalibrate |
A vector of recalibration methods (currently supports 'RecalibrationintheLarge' and/or 'weakRecalibration') |
cohortDefinitions |
A list of cohortDefinitions |
saveDirectory |
The location to save to validation results |
Users need to input a location where the results of the multiple plp analyses are found and the connection and database settings for the new data
Nothing. The results are saved to the saveDirectory
# first develop a model using runMultiplePlp
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
Eunomia::createCohorts(connectionDetails = connectionDetails)
databaseDetails <- createDatabaseDetails(connectionDetails = connectionDetails,
cdmDatabaseId = "1",
cdmDatabaseName = "Eunomia",
cdmDatabaseSchema = "main",
targetId = 1,
outcomeIds = 3)
covariateSettings <-
FeatureExtraction::createCovariateSettings(useDemographicsGender = TRUE,
useDemographicsAge = TRUE, useConditionOccurrenceLongTerm = TRUE)
modelDesign <- createModelDesign(targetId = 1,
outcomeId = 3,
modelSettings = setLassoLogisticRegression(seed = 42),
covariateSettings = covariateSettings)
saveLoc <- file.path(tempdir(), "valiateMultiplePlp", "development")
results <- runMultiplePlp(databaseDetails = databaseDetails,
modelDesignList = list(modelDesign),
saveDirectory = saveLoc)
# now validate the model on a Eunomia but with a different target
analysesLocation <- saveLoc
validationDatabaseDetails <- createDatabaseDetails(connectionDetails = connectionDetails,
cdmDatabaseId = "2",
cdmDatabaseName = "EunomiaNew",
cdmDatabaseSchema = "main",
targetId = 4,
outcomeIds = 3)
newSaveLoc <- file.path(tempdir(), "valiateMultiplePlp", "validation")
validateMultiplePlp(analysesLocation = analysesLocation,
validationDatabaseDetails = validationDatabaseDetails,
saveDirectory = newSaveLoc)
# the results could now be viewed in the shiny app with viewMultiplePlp(newSaveLoc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.