R/R2.r

#' Calculate the explained deviance of a model
#'
#' Calculate the fitness of a model using the following forumla: R-squared = 1 - (estimated variance)/(observed variance)
#'
#' @param model the model to extract the explained deviance from.
#' @return text
#' @export
#'
r2 <- function(model){
  ED =1 - (model$deviance / model$null.deviance)
  return (cat("Explained Deviance [R^2]: ", ED*100, sep=""))
}
xsultan/activity_recognition documentation built on May 4, 2019, 1:26 p.m.