Running the code below using mlr3proba and mlr3pipelines and mlr3filters packages of R to implement rpart algorithm on a preporcessed dataset and performing "variable importance", shows an error:
task <- tsk("iris")
learner <- lrn("classif.rpart")
learner <- po("encode") %>>% po("scale") %>>% po("learner", learner) # preprocessing
learner <- GraphLearner$new(learner) #applying learner on a graph in mlr3pipelines
filter <- flt("importance", learner = learner) #using filter for variable importance
filter$calculate(task)
#Error:
Error in learner$importance() : attempt to apply non-function
But when I run the code above, without preprocessing, it works:
Running the code below using mlr3proba and mlr3pipelines and mlr3filters packages of R to implement rpart algorithm on a preporcessed dataset and performing "variable importance", shows an error:
But when I run the code above, without preprocessing, it works: