% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gedi_plots.R
\name{plot_convergence}
\alias{plot_convergence}
\title{Plot Training Convergence}
\usage{
plot_convergence(
  model,
  layout = c("faceted", "separate", "compact"),
  params = NULL,
  log_scale = TRUE,
  smooth = FALSE,
  title = "Training Convergence"
)
}
\arguments{
\item{model}{GEDI model object}

\item{layout}{Character, layout style:
\itemize{
\item "faceted": Single plot with facet_wrap (default, best for reports)
\item "separate": List of individual plots (for interactive exploration)
\item "compact": Two-panel plot (global vs sample-specific)
}}

\item{params}{Character vector, which parameters to include. Options:
"Z", "A", "o", "Bi", "Qi", "oi", "si", "Rk", "Ro", "sigma2".
NULL means all available.}

\item{log_scale}{Logical, use log10 scale for y-axis}

\item{smooth}{Logical, add smooth trend line}

\item{title}{Character, plot title}
}
\value{
ggplot2 object (for "faceted" or "compact") or list of ggplot2 objects (for "separate")
}
\description{
Visualizes convergence of model parameters during training.
Supports multiple layout styles for different use cases.
}
\examples{
\donttest{
if (requireNamespace("SeuratObject", quietly = TRUE)) {
  pbmc_small <- SeuratObject::pbmc_small
  model <- CreateGEDIObject(
    Samples = pbmc_small@meta.data$orig.ident,
    M       = pbmc_small@assays$RNA@counts,
    K       = 3,
    verbose = 0
  )
  model$train(iterations = 10, track_interval = 2)
  plot_convergence(model)
  plots <- plot_convergence(model, layout = "separate")
}
}

}
