#' @title Fit One or More Models to a Training Set
#' @param historical_data (`data.frame`) A table where samples are in rows and features are in columns.
#' @param model_formula (`formula`) A symbolic description of the model to be fitted.
#' @note \code{model_fit} has access to variables which were assigned to \code{model_environment}.
#' @return A model object
model_fit <- function(historical_data, model_formula)
{
set.seed(1451)
rpart_control <- rpart::rpart.control(
maxdepth = params$maxdepth,
minsplit = params$minsplit,
maxcompete = params$minsplit
)
mdl_obj <- rpart::rpart(
model_formula,
data = historical_data,
method = "anova",
control = rpart_control
)
return(mdl_obj)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.