savePrediction {PatientLevelPrediction} | R Documentation |
Saves the prediction dataframe to a json file
Description
Saves the prediction dataframe to a json file
Usage
savePrediction(prediction, dirPath, fileName = "prediction.json")
Arguments
prediction |
The prediciton data.frame |
dirPath |
The directory to save the prediction json |
fileName |
The name of the json file that will be saved |
Details
Saves the prediction data frame returned by predict.R to an json file and returns the fileLocation where the prediction is saved
Value
The file location where the prediction was saved
Examples
prediction <- data.frame(
rowIds = c(1, 2, 3),
outcomeCount = c(0, 1, 0),
value = c(0.1, 0.9, 0.2)
)
saveLoc <- file.path(tempdir())
savePrediction(prediction, saveLoc)
dir(saveLoc)
# clean up
unlink(file.path(saveLoc, "prediction.json"))
[Package PatientLevelPrediction version 6.4.1 Index]