% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot-methods.R
\name{plot.pptr}
\alias{plot.pptr}
\title{Plot a pptr model.}
\usage{
\method{plot}{pptr}(x, type = NULL, metric = NULL, node = 1L, ...)
}
\arguments{
\item{x}{A pptr model.}

\item{type}{Character string specifying the plot type. \code{NULL} (default)
shows a mosaic overview. Other options: \code{"structure"} for tree with
embedded histograms, \code{"importance"} for variable importance,
\code{"projection"} for projected data at a node,
\code{"boundaries"} for decision boundaries in feature space.}

\item{metric}{Character string selecting a single importance metric
to plot: \code{"projections"}, \code{"weighted"}, or
\code{"permuted"} (availability depends on the model).  \code{NULL}
(default) shows all available metrics together.  Only used when
\code{type = "importance"}.}

\item{node}{Integer index of the node for projection plots (1-based, breadth-first
order). Defaults to 1 (root node). Only used when \code{type = "projection"}.}

\item{...}{Additional arguments passed to the internal plotting function.}
}
\value{
A ggplot2-compatible object (invisibly). The mosaic layout returns
  a patchwork object that works with \code{ggplot2::ggsave()}.
}
\description{
Visualizes a pptr model. By default, shows a mosaic overview with tree
structure, decision boundaries, and variable importance. Use \code{type}
to show individual plots.
}
\examples{
\donttest{
if (requireNamespace("ggplot2", quietly = TRUE) &&
    requireNamespace("patchwork", quietly = TRUE)) {
  model <- pptr(Species ~ ., data = iris)
  plot(model)                         # mosaic overview
  plot(model, type = "structure")     # tree structure only
  plot(model, type = "importance")    # variable importance
  plot(model, type = "projection")    # projection histogram
  plot(model, type = "boundaries")    # decision boundaries
}
}
}
