% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/kerasnip_spec_methods.R
\name{predict.kerasnip_model_fit}
\alias{predict.kerasnip_model_fit}
\title{Predict Method for kerasnip Model Fits}
\usage{
\method{predict}{kerasnip_model_fit}(object, new_data, ...)
}
\arguments{
\item{object}{A \code{kerasnip_model_fit} object.}

\item{new_data}{A data frame of predictors.}

\item{...}{Passed to the parsnip predict method.}
}
\value{
A tibble of predictions.
}
\description{
S3 method for \code{predict()} dispatched on \code{kerasnip_model_fit} objects.
Before delegating to the standard parsnip predict machinery, it checks
whether the underlying model type is registered in the current parsnip
session. If not (e.g. after loading a saved workflow in a new R session),
it transparently replays the full parsnip registration using metadata stored
on the spec object — requiring no manual step from the user.
}
\details{
The metadata needed for re-registration (\code{kerasnip_layer_blocks},
\code{kerasnip_functional}) is embedded on the spec object by the spec
constructor function at call time. This means it is preserved across
\code{saveRDS()}/\code{readRDS()} and \code{bundle()}/\code{unbundle()} round-trips.

For full model weight portability (i.e. to be able to \code{predict()} on new
data in a new R session), use \code{bundle::bundle()} before saving. Plain
\code{saveRDS()} preserves the spec structure and will auto-register, but the
underlying Keras model weights are not portable without bundling.
}
\keyword{internal}
