Skip to contents

PFI Class

PFI Class

Details

Calculates Permutation Feature Importance (PFI) scores.

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

PFI$new(task, learner, measure, resampling = NULL, features = NULL)

Arguments

task, learner, measure, resampling, features

Passed to FeatureImportanceLearner for construction.


Method compute()

A short description...

Usage

PFI$compute(relation = c("difference", "ratio"))

Arguments

relation

(character(1)) Calculate "difference" (default) or "ratio" of original scores and scores after permutation


Method clone()

The objects of this class are cloneable with this method.

Usage

PFI$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


library(mlr3)

pfi = PFI$new(
  task = tsk("zoo"),
  learner = lrn("classif.rpart"),
  measure = msr("classif.ce")
)

pfi$compute()
#>   airborne    aquatic   backbone   breathes    catsize   domestic       eggs 
#> 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 
#>   feathers       fins       hair       legs       milk   predator       tail 
#> 0.14705882 0.08823529 0.00000000 0.00000000 0.47058824 0.00000000 0.00000000 
#>    toothed   venomous 
#> 0.00000000 0.00000000