Proportion Within
Calculates weighted proportion of predictions that are within a given tolerance around the actual values. The larger the value, the better.
prop_within(actual, predicted, w = NULL, tol = 1, ...)
actual |
Observed values. |
predicted |
Predicted values. |
w |
Optional case weights. |
tol |
Predictions in the closed interval from actual - tol to actual + tol count as within. |
... |
Further arguments passed to |
A numeric vector of length one.
prop_within(1:10, c(1:9, 12)) prop_within(1:10, c(1:9, 12), w = rep(1, 10)) prop_within(1:10, c(1:9, 12), w = 1:10) data <- data.frame(act = 1:10, pred = c(1:9, 12), w = 1:10) multi <- multi_metric(fun = prop_within, tol = 0:3) performance(data, actual = "act", predicted = "pred", w = "w", metrics = multi, key = "Proportion within")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.