earlystop | R Documentation |
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
earlystop(
x,
window = 10,
window_decrease_pct_min = 0.01,
total_decrease_pct_max = NULL,
verbose = TRUE
)
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 |
total_decrease_pct_max |
Float: Stop if improvement from first to last step exceeds this percent. If defined, overrides |
verbose |
Logical: If TRUE, print messages to console. Default = TRUE |
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.
E.D. Gennatas
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.