Skip to contents

Serializes a pptr or pprf model to JSON format compatible with the C++ CLI. The JSON includes the model structure, group labels, training parameters, and optionally variable importance metrics.

Usage

save_json(model, path, ...)

# S3 method for class 'pptr'
save_json(model, path, include_metrics = TRUE, ...)

# S3 method for class 'pprf'
save_json(model, path, include_metrics = TRUE, ...)

Arguments

model

A pptr or pprf model.

path

File path to write the JSON to.

...

Additional arguments (currently unused).

include_metrics

If TRUE (default), include variable importance and (for forests) OOB error in the output. Set to FALSE to save only the model structure and metadata.

See also

Examples

model <- pptr(Type ~ ., data = iris, seed = 0)
path <- tempfile(fileext = ".json")
save_json(model, path)