#' Evaluate different models
#'
#' @return data.frame. Result of the different models evaluation
#' @export
evaluate_models <- function() {
na_replacements <- list("mean", "downup", "drop", FALSE)
splits <- seq(.65, .8, .05)
classify <- c(TRUE, FALSE)
scorings <- list("neg_mean_absolute_error", NULL)
ord_scores <- c(TRUE, FALSE)
models <- list(MinirocketModel()) # leaves open handling of different models
names(models) <- lapply(models, function(m) m$name)
evaluations <- vector(mode = "list", length = length(models))
names(evaluations) <- names(models)
for (n in names(models)) {
model <- models[[n]]
tryCatch({
evaluations[[n]] <- evaluate(model, na_replacements, splits, classify, scorings, ord_scores)
},
error = function(e) {
message(paste0("Error with model: ", n))
print(e)
})
}
lapply(names(evaluations), function(name) dplyr::mutate(evaluations[[name]], name = name)) %>%
data.table::rbindlist() %>%
dplyr::relocate(name)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.