R/myerror.R

Defines functions myerror

Documented in myerror

myerror <-
function(predict, true){
	# compute the error of the predict list given the true list
	
	if(length(predict) != length(true)) stop("predict and true have different length")	
	ntest = length(predict)	
	error = length(which(predict != true))/ntest
	error
	
}

Try the snn package in your browser

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

snn documentation built on May 1, 2019, 7:05 p.m.