Skip to content

Add local.importance parameter in ranger learners #363

@gi-marengo

Description

@gi-marengo

The ranger package supports the parameter local.importance = TRUE to compute casewise variable importance values.
This is very useful for model interpretability, but currently the parameter is not available in the ranger learners.
Is possible to add it?

I also tried to add the parameter manually as suggested in the mlr3 learner class documentation:

# Example provided in the mlr3 learner class documentation for classif.rpart

lrn = lrn("classif.rpart")
lrn$param_set$add(paradox::ParamFct$new("foo", levels = c("a", "b"))) 

lrn$param_set$add(paradox::ps(foo = p_fct(c("a", "b")))) # also with the syntax of paradox 1.0.1

However, in the current paradox version the $add() method is no longer available, leading to

> Error: attempt to apply a non-function.

and I didn’t find an alternative way to add a new parameter to an existing learner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions