R/regr_maxae.R

Defines functions maxae

Documented in maxae

#' @title Max Absolute Error
#'
#' @details
#' The Max Absolute Error is defined as \deqn{
#'   \max \left( \left| t_i - r_i \right| \right).
#'  }{
#'    max(abs(t - r)).
#'  }
#'
#' @templateVar mid maxae
#' @template regr_template
#'
#' @inheritParams regr_params
#' @template regr_example
#' @export
maxae = function(truth, response, ...) {
  assert_regr(truth, response = response)
  max(.ae(truth, response))
}

#' @include measures.R
add_measure(maxae, "Max Absolute Error", "regr", 0, Inf, TRUE, obs_loss = "ae")

Try the mlr3measures package in your browser

Any scripts or data that you put into this service are public.

mlr3measures documentation built on Aug. 5, 2022, 5:22 p.m.