#' @title False Negatives
#'
#' @details
#' This measure counts the false negatives (type 2 error), i.e. the number of
#' predictions indicating a negative class label while in fact it is positive.
#' This is sometimes also called a "miss" or an "underestimation".
#'
#' @templateVar mid fn
#' @template binary_template
#'
#' @references
#' \url{https://en.wikipedia.org/wiki/Template:DiagnosticTesting_Diagram}
#'
#' @inheritParams binary_params
#' @template binary_example
#' @export
fn = function(truth, response, positive, sample_weights = NULL, ...) {
  assert_binary(truth, response = response, positive = positive)
  fn_cm(cm(truth, response, positive, sample_weights))
}

fn_cm = function(m, na_value = NaN) {
  m[2L, 1L]
}

#' @include measures.R
add_measure(fn, "False Negatives", "binary", 0, Inf, TRUE)
