Variable Importance P-Values

94 Views Asked by At

Can the importance_pvalues (https://rdrr.io/cran/ranger/man/importance_pvalues.html) command be used via mlr3? In other words, can I indicate that I would like the p-values outputted in my call to the learner? If not, how would I go about extracting the ranger object to use as input for the importance_pvalues command?

1

There are 1 best solutions below

0
be-marc On BEST ANSWER

You can always access the stored model via the $model field in mlr3.

library(mlr3verse)
library(ranger)

learner = lrn("classif.ranger", importance = "impurity_corrected")
learner$train(tsk("sonar"))

importance_pvalues(learner$model)