Saves the prediction dataframe to a json file
Details
Saves the prediction data frame returned by predict.R to an json file and returns the fileLocation where the prediction is 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)
#> [1] "/tmp/RtmprbAIgc/prediction.json"
dir(saveLoc)
#> [1] "bslib-06efc2221334b2a33f1b93cebda927e4"
#> [2] "downlit"
#> [3] "file211717aa70d1.sqlite"
#> [4] "file2117184e4c7b"
#> [5] "file211719628c4d.sqlite"
#> [6] "file21172937b3ed.sqlite"
#> [7] "file21172ba21f1b.sqlite"
#> [8] "file21172d123356.sqlite"
#> [9] "file211736377a93.sqlite"
#> [10] "file2117429f3c3b"
#> [11] "file21174f995229"
#> [12] "file21175784d344.sqlite"
#> [13] "file21175f3453c0.sqlite"
#> [14] "file2117685b06f9.sqlite"
#> [15] "file21176ca25ad2.sqlite"
#> [16] "file21177b46c5f6"
#> [17] "file2117ab524c2.sqlite"
#> [18] "file2117ae72ca5.sqlite"
#> [19] "prediction.json"
#> [20] "temp_libpath21175753d543"
# clean up
unlink(file.path(saveLoc, "prediction.json"))