| load_json | R Documentation |
Deserializes a pptr or pprf model from a JSON file. The model
can be used for prediction immediately. If variable importance metrics and
OOB fields were saved, they are restored into the model's lazy-computation
cache so later accessor calls (oob_error(), permuted_importance(),
etc.) return the stored values without recomputation.
load_json(path)
path |
File path to read the JSON from. |
Note that formula, x, and y are not stored in the JSON
and will be NULL on the loaded model. Formula-based prediction and
any accessor that requires training data will error unless the user
re-attaches those fields.
A pptr or pprf model (with the appropriate
_classification / _regression subclass).
save_json, pptr, pprf
model <- pptr(Species ~ ., data = iris, seed = 0)
path <- tempfile(fileext = ".json")
save_json(model, path)
loaded <- load_json(path)
predict(loaded, as.matrix(iris[, 1:4]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.