% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-ml.R
\name{geom_lift_gain}
\alias{geom_lift_gain}
\title{Lift and cumulative gain curves}
\usage{
geom_lift_gain(
  mapping = NULL,
  data = NULL,
  type = "gain",
  color = NULL,
  baseline = TRUE
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map the score to \code{score}
and the binary outcome to \code{truth}.}

\item{type}{\code{"gain"} (cumulative captured) or \code{"lift"} (ratio to random).}

\item{color}{Curve color.}

\item{baseline}{Draw the random-targeting reference.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Sorts observations by predicted score and plots the cumulative share of
positives captured against the share of the population targeted — the
standard way to size a marketing or triage cutoff.
}
\examples{
set.seed(1)
s <- runif(200)
d <- data.frame(score = s, y = rbinom(200, 1, s))
ggnext(d, aes(score = score, truth = y)) + geom_lift_gain()
}
