Nothing
# Mock a minimal PipelineResults object
mock_pipelineresults <- readRDS("./fixtures/PipelineResults.rds")
# Test 1: Check if the function returns a list of ggplot objects
test_that("plot_feature_importance returns a list of ggplot objects", {
plots <- plot_feature_importance(mock_pipelineresults)
expect_type(plots, "list")
expect_s3_class(plots[[1]], "gg")
})
# Test 2: Check if the list length matches the number of methods in inbuilt_feature_importance
test_that("List length matches number of methods", {
plots <- plot_feature_importance(mock_pipelineresults)
expect_equal(length(plots), length(mock_pipelineresults@inbuilt_feature_importance))
})
# Test 3: Check if it handles the absence of permutation_importance correctly
test_that("Handles absence of permutation_importance correctly", {
mock_pipelineresults_no_perm <- mock_pipelineresults
mock_pipelineresults_no_perm@permutation_importance <- list() # Use an empty list instead of NULL
plots <- plot_feature_importance(mock_pipelineresults_no_perm)
expect_type(plots, "list")
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.