% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.gg_beta_varpro.R
\name{plot.gg_beta_varpro}
\alias{plot.gg_beta_varpro}
\title{Plot a \code{gg_beta_varpro} object}
\usage{
\method{plot}{gg_beta_varpro}(x, ...)
}
\arguments{
\item{x}{A \code{gg_beta_varpro} object from \code{\link[=gg_beta_varpro]{gg_beta_varpro()}}.}

\item{...}{Not currently used.}
}
\value{
A \code{ggplot} object.
}
\description{
Horizontal bar chart of the mean absolute coefficient
\eqn{\mathrm{mean}(|\hat{\beta}|)}{mean(|beta hat|)} per variable, sorted
descending so
the eye lands on the top variable first. Bars filled blue when above the
selection cutoff, grey otherwise. Dashed red line marks the cutoff.
}
\section{Reading the chart}{

Each bar is the average magnitude of a per-rule lasso coefficient for
that variable. \strong{The numeric scale carries the predictor's units.}
If "age" is in years and "creatinine" is in mg/dL, a longer bar for
age does not mean age is "more important" in any unit-free sense.
Comparisons across data sets or across variables with very different
units require keeping the units context in mind. Within one data set,
bars are comparable up to that unit caveat.

Variables above the cutoff are coloured blue and flagged \code{selected};
variables below are grey. Lasso shrinkage can drive a rule's
\eqn{\hat{\beta}}{beta hat} to
exactly zero; those rules are kept in the average, so a variable
with many shrunk-to-zero rules will sit lower in the ranking than
one whose released coefficients are consistently non-zero.

For a classification fit, variables are sorted by
\verb{mean(|sum-of-class-beta|)} descending and that ordering is shared
across every facet, so rows line up between classes for visual
comparison. Each facet has its own cutoff line.
}

\section{What this tells you}{

Use the bar chart as a selection ranking, not as an effect-size axis.
Pair it with \code{\link[=gg_varpro]{gg_varpro()}} to see where split-strength importance and
local lasso-beta importance agree or disagree; disagreement is often the
interesting signal.
}

\examples{
\donttest{
if (requireNamespace("varPro", quietly = TRUE)) {
  set.seed(1)
  v <- varPro::varpro(mpg ~ ., data = mtcars, ntree = 50)
  plot(gg_beta_varpro(v))
}
}

}
\seealso{
\code{\link[=gg_beta_varpro]{gg_beta_varpro()}}.
}
