% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-ml.R
\name{geom_partial_dependence}
\alias{geom_partial_dependence}
\title{Partial dependence and ICE curves}
\usage{
geom_partial_dependence(
  mapping = NULL,
  data = NULL,
  color = NULL,
  ice = TRUE,
  ice_alpha = 0.25,
  linewidth = NULL
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map the feature to \code{x} and
the prediction to \code{y}; map \code{group} for ICE curves.}

\item{color}{Curve color.}

\item{ice}{Draw the individual ICE curves under the average.}

\item{ice_alpha}{Opacity of the ICE curves.}

\item{linewidth}{Width of the average line.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
A thick average partial-dependence line over thin per-observation ICE
curves. Map \code{group} to the observation id to draw the ICE spaghetti.
}
\examples{
d <- data.frame(
  x = rep(1:10, 5), id = rep(1:5, each = 10),
  pred = as.vector(sapply(1:5, function(i) (1:10) * 0.1 * i + rnorm(10, 0, .1)))
)
ggnext(d, aes(x, pred, group = id)) + geom_partial_dependence()
}
