tidyverts / fabletools

General fable features useful for extension packages

Home Page:http://fabletools.tidyverts.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `coverage()` accuracy metric

mitchelloharawild opened this issue · comments

coverage <- function(.dist, .actual, percentile = 80, na.rm = TRUE, ...){
  intvl <- hilo(.dist, percentile)
  within <- (.actual > intvl$lower) & (.actual < intvl$upper)
  mean(within)
}