% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{autoplot_diagnostics}
\alias{autoplot_diagnostics}
\alias{plot_diagnostics}
\title{Plot prediction diagnostics for a fitted neural network}
\usage{
autoplot_diagnostics(object, actual, ...)

plot_diagnostics(object, actual, ...)
}
\arguments{
\item{object}{A fitted model of class \code{nn_fit}, as returned by
\code{\link[=train_nn]{train_nn()}}, \code{\link[=ffnn]{ffnn()}}, or \code{\link[=rnn]{rnn()}}.}

\item{actual}{A vector of true response values, the same length as the
training data used to fit \code{object}.}

\item{...}{Additional arguments (currently unused).}
}
\value{
For regression, a named list of \code{\link[ggplot2:ggplot]{ggplot2::ggplot()}} objects (one per
diagnostic panel). For classification, a single \code{\link[ggplot2:ggplot]{ggplot2::ggplot()}}
confusion matrix heatmap.
}
\description{
Produces diagnostic plots comparing fitted values against actual (true)
response values for a fitted \code{nn_fit} model.
\itemize{
\item \strong{Regression (single output)}: returns a named list with two panels --
residuals vs fitted and actual vs fitted.
\item \strong{Regression (multi-output)}: returns a named list with one actual vs
fitted panel per output column.
\item \strong{Classification}: returns a single confusion matrix heatmap.
}
}
\examples{
\donttest{
  if (torch::torch_is_installed()) {
    # Regression
    m = train_nn(
      as.matrix(iris[, 2:4]), iris$Sepal.Length,
      epochs = 5
    )
    autoplot_diagnostics(m, actual = iris$Sepal.Length)

    # Classification
    m_cls = train_nn(
      as.matrix(iris[, 1:4]), iris$Species,
      epochs = 5
    )
    autoplot_diagnostics(m_cls, actual = iris$Species)
  }
}

}
