#' Train Model
#'
#' This function takes a test dataset and fits our CART Classification Tree model and Logistic Regression GLM model to the given set.
#'
#' @param train The dataset you would like to train models on, if goal is prediction must use Split() ahead of time so model is naive to test observations.
#'
#' @export
TrainModels <- function(train){
out <- list()
C5_model <- C50::C5.0(x = train[,c("ML","SP","SPTDR","MLTR","SPTR","PBR","MLTDR","H1A0")],
y = train$strWL,
control = C50::C5.0Control(minCases = 1))
GLM_model <- glm(strWL~SP+SPTR*D0F1+H1A0+MLTR:D0F1+ML:SPTR+PBR,data = train,family=binomial)
out[[1]] <- C5_model
out[[2]] <- GLM_model
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.