Learn R Programming

PatientLevelPrediction (version 6.4.1)

savePlpModel: Saves the plp model

Description

Saves the plp model

Usage

savePlpModel(plpModel, dirPath)

Value

                    The directory path where the model was saved

Arguments

plpModel

A trained classifier returned by running runPlp()$model

dirPath

A location to save the model to

Details

Saves the plp model to a user specificed folder

Examples

Run this code
  # takes too long 
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n = 1000)
saveLoc <- file.path(tempdir(), "savePlpModel")
plpResult <- runPlp(plpData, outcomeId = 3, saveDirectory = saveLoc)
path <- savePlpModel(plpResult$model, file.path(saveLoc, "savedModel"))
# show the saved model
dir(path, full.names = TRUE)

# clean up
unlink(saveLoc, recursive = TRUE)

Run the code above in your browser using DataLab