% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-ml.R
\name{geom_decision_boundary}
\alias{geom_decision_boundary}
\title{Decision-boundary region plot}
\usage{
geom_decision_boundary(mapping = NULL, data = NULL, alpha = NULL)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map the grid coordinates to
\code{x}/\code{y} and the predicted class to \code{color}.}

\item{alpha}{Region opacity.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Shades a grid of predictions to show a two-dimensional classifier's
decision regions; overlay \code{geom_point()} for the training data.
}
\examples{
g <- expand.grid(x = seq(0, 1, 0.05), y = seq(0, 1, 0.05))
g$cls <- ifelse(g$x + g$y > 1, "a", "b")
ggnext(g, aes(x, y, color = cls)) + geom_decision_boundary()
}
