recalibratePlpRefit {PatientLevelPrediction} | R Documentation |
recalibratePlpRefit
Description
Recalibrating a model by refitting it
Usage
recalibratePlpRefit(plpModel, newPopulation, newData, returnModel = FALSE)
Arguments
plpModel |
The trained plpModel (runPlp$model) |
newPopulation |
The population created using createStudyPopulation() who will have their risks predicted |
newData |
An object of type |
returnModel |
Logical: return the refitted model |
Value
An prediction dataframe with the predictions of the recalibrated model added
Examples
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n = 1000)
saveLoc <- file.path(tempdir(), "recalibratePlpRefit")
plpResults <- runPlp(plpData, outcomeId = 3, saveDirectory = saveLoc)
newData <- simulatePlpData(simulationProfile, n = 1000)
newPopulation <- createStudyPopulation(newData, outcomeId = 3)
predictions <- recalibratePlpRefit(plpModel = plpResults$model,
newPopulation = newPopulation,
newData = newData)
# clean up
unlink(saveLoc, recursive = TRUE)
[Package PatientLevelPrediction version 6.4.1 Index]