earlystop: Early stopping

View source: R/earlystop.R

earlystopR Documentation

Early stopping

Description

Check loss vector for early stopping criteria: - either total percent decrease from starting error (e.g. if predictions started at expectation) - or minimum percent decrease (relative to the first value of the vector) over a window of last n steps

Usage

earlystop(
  x,
  window = 10,
  window_decrease_pct_min = 0.01,
  total_decrease_pct_max = NULL,
  verbose = TRUE
)

Arguments

x

Numeric vector: loss at each iteration

window

Integer: Number of steps to consider

window_decrease_pct_min

Float: Stop if improvement is less than this percent over last window steps

total_decrease_pct_max

Float: Stop if improvement from first to last step exceeds this percent. If defined, overrides window_decrease_pct_min

verbose

Logical: If TRUE, print messages to console. Default = TRUE

Details

If the first loss value was set to be the loss when yhat = mean(y) (e.g. in boosting), then total_decrease_pct_max corresponds to R-squared and window_decrease_pct_min to percent R-squared improvement over window last steps.

Author(s)

E.D. Gennatas


egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.