#' Custom Rounding
#'
#' Does custom rounding on user defined cutpoint for classification problems.
#'
#' @param num The number being rounded.
#' @param pos_thresh The threshold between 0 and 1 that the number will be rounded.
#' @return A rounded number at the defined threshold.
#' @export
customRound <- function(num, pos_thresh) {
adj <- pos_thresh - 0.5
num_adj <- num - adj
num_adj <- ifelse(num_adj < 0, 0, num_adj)
return(round(num_adj))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.