% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/json.R
\name{save_json}
\alias{save_json}
\alias{save_json.ppmodel}
\title{Save a model to a JSON file.}
\usage{
save_json(model, path, ...)

\method{save_json}{ppmodel}(model, path, include_metrics = TRUE, ...)
}
\arguments{
\item{model}{A \code{pptr} or \code{pprf} model (inheriting from \code{ppmodel}).}

\item{path}{File path to write the JSON to.}

\item{...}{Additional arguments (currently unused).}

\item{include_metrics}{If \code{TRUE} (default), include variable importance
and (for forests) OOB error in the output. Set to \code{FALSE} to save
only the model structure and metadata.}
}
\value{
Invisibly returns the file \code{path} that was written (a length-one
  character string). Called for its side effect of serializing \code{model}
  to a JSON file at \code{path}.
}
\description{
Serializes a \code{pptr} or \code{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.
}
\examples{
model <- pptr(Species ~ ., data = iris, seed = 0)
path <- tempfile(fileext = ".json")
save_json(model, path)

}
\seealso{
\code{\link{load_json}}, \code{\link{pptr}}, \code{\link{pprf}}
}
