R/TreePrediction.R

Defines functions TreePrediction

Documented in TreePrediction

#' 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)
  }
dennist2/MerlinV1 documentation built on Dec. 11, 2019, 8:41 p.m.