R/confusion.matrix.fn.threshold.R

Defines functions confusion.matrix.fn.threshold

Documented in confusion.matrix.fn.threshold

#' Confusion Matrix Generation - Threshold Function  
#' 
#' Returns a function for use with confusion.matrix based on actual or predicted being larger than a particular value. 
#'
#' @param threshold Scalar - Value to compare actual and predicted with.
#'
#' @return A function for use with a call to confusion.matrix(). 
confusion.matrix.fn.threshold <- function(threshold) {
  f <- function(x) {
    ifelse(x > threshold,1,0)
  }
  f
}
burrm/lolcat documentation built on Aug. 15, 2024, 6:16 p.m.