# get some data...
load("cv_results_example.Rda")
# a helper function to test the aggregate_CV_split_results() and
# aggregate_resample_run_results() don't give errors
test_aggregate_functions_work <- function(result_metric_obj){
# check aggregate_CV_split_results() doesn't give an error
aggregated_cv_rm <- aggregate_CV_split_results(result_metric_obj, all_cv_results)
# while actually not completely required, in general aggregator functions should
# reduce the number of rows in the data
expect_lte(dim(aggregated_cv_rm)[1], dim(all_cv_results)[1])
# combine the data twice to create data from 2 resample runs
fake_resample_run_data <- rbind(aggregated_cv_rm, aggregated_cv_rm)
# check aggregate_resample_run_results() doesn't give an error
aggregated_resample_rm <- aggregate_resample_run_results(fake_resample_run_data)
# only will reduce size of data if I have data from multiple CV runs...
expect_lte(dim(aggregated_resample_rm)[1], dim(fake_resample_run_data)[1])
}
test_that("rm_confusion_matrix aggregate methods don't give errors", {
cm_rm <- rm_confusion_matrix()
expect_null(test_valid_result_metric(cm_rm))
test_aggregate_functions_work(cm_rm)
})
test_that("rm_main_results aggregate methods don't give errors", {
main_rm <- rm_main_results() #, save_only_same_train_test_time = TRUE)
expect_null(test_valid_result_metric(main_rm))
test_aggregate_functions_work(main_rm)
main_rm_2 <- rm_main_results("diag", "diag")
test_aggregate_functions_work(main_rm_2)
main_rm_3 <- rm_main_results(FALSE, FALSE)
test_aggregate_functions_work(main_rm_3)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.