R/forest_accuracy.R

Defines functions forest_accuracy

Documented in forest_accuracy

#' Forest Accuracy
#'
#' Retrieve the forest accuracy (1 - OOB)
#'
#' @param model a randomForest model object
#' @return a numeric value for the model accuracy (0 - 1)
#'
#' @export

forest_accuracy <- function(model)
{
  oob <- model$err.rate
  acc <- 1 - as.numeric(oob[nrow(oob), "OOB"][[1]])
  return(round(acc, digits = 2))
}
wilsontom/modelmisc documentation built on Nov. 22, 2019, 12:22 a.m.