#' TreePrediction
#'
#' This function takes a trained C5.0 Classification Tree and returns predictions based on the training data set provided.
#'
#'
#' @param model The fit CART Model to run predictions through.
#' @param test The test dataset for predictions to be made on.
#'
#' @export
TreePrediction <- function(model,test){
preds <- stats::predict(model,test,type='prob')
predsC <- stats::predict(model,test,type='class')
preds <- data.frame(preds)
colnames(preds) <- c("PrL","PrW")
table <- data.frame(Date=test$Date,Team=test$Team,PrL=preds$PrL,PrW=preds$PrW,PrWL=predsC)
return(table)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.