R/cost01.R

#' @title cost.01
#' @description 0-1 loss function
#' @export cost.01
#' @return 0-1 loss
#' @param y Response
#' @param yhat The predicted value

cost.01 <- function(y, yhat)
{
    mean(y!=yhat)
}

Try the freestats package in your browser

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

freestats documentation built on May 2, 2019, 1:18 p.m.