Computes either LOCO or LOCI depending on whether feature of interest is designated to be left out (LOCO) or left in (LOCI)
Value
A data.table with columns feature
and <measure$id>_post
.
Examples
library(mlr3)
learner = lrn("classif.rpart")
task = tsk("breast_cancer")
measure = msr("classif.ce")
split = partition(task)
train_ids = split$train
test_ids = split$test
# Computing scores for all features
features = task$feature_names
# LOCO
compute_loc(
learner,
task,
train_ids = split$train,
test_ids = split$test,
features,
measure,
direction = "leave-out"
)
#> Error in compute_loc(learner, task, train_ids = split$train, test_ids = split$test, features, measure, direction = "leave-out"): could not find function "compute_loc"
# LOCI
compute_loc(
learner,
task,
train_ids = split$train,
test_ids = split$test,
features,
measure,
direction = "leave-in"
)
#> Error in compute_loc(learner, task, train_ids = split$train, test_ids = split$test, features, measure, direction = "leave-in"): could not find function "compute_loc"