savePrediction | R Documentation |
Saves the prediction dataframe to a json file
savePrediction(prediction, dirPath, fileName = "prediction.json")
prediction |
The prediciton data.frame |
dirPath |
The directory to save the prediction json |
fileName |
The name of the json file that will be saved |
Saves the prediction data frame returned by predict.R to an json file and returns the fileLocation where the prediction is saved
The file location where the prediction was saved
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.