% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/persistence.R
\name{save_onam}
\alias{save_onam}
\title{Save a fitted onam model to disk}
\usage{
save_onam(object, dir, overwrite = FALSE)
}
\arguments{
\item{object}{Object of class \code{onam} as returned by \link{onam}.}

\item{dir}{Directory the model is saved to. Created if it does not exist.}

\item{overwrite}{Should an existing directory of the same name be
overwritten?}
}
\value{
No return value, called for side effects.
}
\description{
An \code{onam} object holds one or more fitted 'keras' submodels per ensemble
member (in \code{object$ensemble[[i]]$model_list}), which cannot be
serialized with \code{saveRDS()} alone. This function saves each submodel to
its own \code{.keras} file and the remaining orthogonalization metadata
(weights, \code{model_info}, data, predictions, ...) to a single \code{.rds} file,
all inside \code{dir}. Use \link{load_onam} to restore the object.
}
\seealso{
\link{load_onam}
}
