R/MAE.R

Defines functions MAE

Documented in MAE

MAE <- function(Y,Ypred)
{
	Ypred <- as.numeric(Ypred)
	Y    <- as.numeric(Y)
	if(length(Ypred)!=length(Y)){
		stop("The entries must have the same length.")
	}
	return(mean(abs(Y-Ypred)))
}

Try the DiceEval package in your browser

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

DiceEval documentation built on July 4, 2022, 9:05 a.m.