Training and validation score against training-set size or epoch, the standard read on whether a model is data-limited or over-fitting.

geom_learning_curve(
  mapping = NULL,
  data = NULL,
  band = TRUE,
  linewidth = NULL,
  points = TRUE
)

Arguments

mapping, data

Standard layer overrides. Map size/epoch to x, the score to y, and the split ("train"/"validation") to color.

band

Draw a ribbon between ymin and ymax when supplied.

linewidth

Line width.

points

Draw markers at each measured point.

Value

A Layer to add with +.

Examples

d <- data.frame(
  n = rep(c(50, 100, 200, 400), 2),
  score = c(.75, .82, .86, .88, .70, .78, .83, .86),
  split = rep(c("train", "validation"), each = 4)
)
ggnext(d, aes(n, score, color = split)) + geom_learning_curve()
#> <ggnext plot>
#>   data:  8 x 3
#>   aes:   x = n, y = score, color = split
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static