tests/RSquared.R

RSquared<-function(pred,true){
	# Pierre Gramme
	# Jan 2015
	# Compute the R-squared coefficient of determination
	
	ss_tot = sum((true-mean(true)) ^ 2)
	ss_res = sum((true-pred) ^ 2)
  return(1 - ss_res/ss_tot)
}

Try the LiblineaR package in your browser

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

LiblineaR documentation built on May 29, 2024, 7:13 a.m.