% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vis_module.R
\name{plot_qshap}
\alias{plot_qshap}
\title{Plot Q-SHAP R-squared contributions}
\usage{
plot_qshap(
  x,
  type = c("rsq", "elbow", "cumu", "gcorr", "hist", "density", "loss"),
  ...
)
}
\arguments{
\item{x}{A `qshap_rsq` object (recommended) or a numeric vector.}

\item{type}{Plot type; see `plot.qshap_rsq`. Use `"loss"` to launch the interactive explorer (requires a loss matrix).}

\item{...}{Additional arguments passed to the underlying visualization
function (e.g., `label`, `rotation`, `color_map_name`, `max_feature`).}
}
\value{
The ggplot2 plot object (invisibly)
}
\description{
Convenience wrapper that works for both a `qshap_rsq` object and a plain
numeric vector of contributions. Use this if you have a numeric vector and
still want to pass arguments like `color_map_name`.
}
\examples{
library(xgboost)
set.seed(42)
n <- 100
p <- 100
X <- matrix(rnorm(n * p), nrow = n, ncol = p)
y <- X[, 1] - X[, 2] + rnorm(n, sd = 0.2)
model <- xgboost(X, y, nrounds = 15L, max_depth = 2L, verbosity = 0L, nthreads = 1L)
explainer <- gazer(model)
phi_rsq <- rsq(explainer, X, y)
plot(phi_rsq)

}
\keyword{internal}
