% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-ml.R
\name{geom_calibration}
\alias{geom_calibration}
\title{Calibration curve}
\usage{
geom_calibration(
  mapping = NULL,
  data = NULL,
  bins = 10,
  color = NULL,
  diagonal = TRUE
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map the predicted
probability to \code{x} and the binary outcome (0/1) to \code{y}.}

\item{bins}{Number of probability bins.}

\item{color}{Curve color.}

\item{diagonal}{Draw the perfect-calibration reference line.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Bins predicted probabilities and plots the observed event rate in each
bin against the mean prediction, with the diagonal marking perfect
calibration. Points off the diagonal show over- or under-confidence.
}
\examples{
set.seed(1)
p <- runif(300)
d <- data.frame(pred = p, obs = rbinom(300, 1, p^1.3))
ggnext(d, aes(pred, obs)) + geom_calibration()
}
