Skip to contents

Combine two FeatureImportanceMethod objects

Usage

# S3 method for class 'FeatureImportanceMethod'
c(x, y, ...)

Arguments

x, y

([FeatureImportanceMethod]) Objects to combine. Must have computed scores.

...

(any) Ignored.

Value

New object of the same subclass as x and y.

Examples

library(mlr3)
task = tgen("2dnormals")$generate(n = 100)

pfi1 = PFI$new(
  task = task,
  learner = lrn("classif.ranger", num.trees = 50, predict_type = "prob"),
  measure = msr("classif.ce"),
  features = "x1"
)
#>  No <Resampling> provided, using holdout resampling with default ratio.
pfi1$compute()
#> Key: <feature>
#>    feature importance
#>     <char>      <num>
#> 1:      x1  0.2121212

pfi2 = PFI$new(
  task = task,
  learner = lrn("classif.ranger", num.trees = 50, predict_type = "prob"),
  measure = msr("classif.ce"),
  features = "x2"
)
#>  No <Resampling> provided, using holdout resampling with default ratio.
pfi2$compute()
#> Key: <feature>
#>    feature importance
#>     <char>      <num>
#> 1:      x2 0.06060606

combined = c(pfi1, pfi2)