
Perform statistical comparison of models using cross-validation
Source:R/model-selection.R
tl_test_model_difference.RdPerform statistical comparison of models using cross-validation
Value
A data frame with columns metric, model,
baseline, mean_diff, p_value, and
p_adj (Holm-adjusted p-value) containing pairwise
statistical comparisons against the baseline model.
Examples
# \donttest{
m1 <- tl_model(mtcars, mpg ~ wt, method = "linear")
m2 <- tl_model(mtcars, mpg ~ wt + hp, method = "linear")
cv <- tl_compare_cv(mtcars, list(simple = m1, full = m2), folds = 3)
tl_test_model_difference(cv, baseline_model = "simple", metric = "rmse")
#> metric model baseline mean_diff p_value p_adj
#> 1 rmse full simple -0.4229862 0.0656034 0.0656034
# }