mlr support for xgb.create.features - how to use?

150 views Asked by At

There is a function in the r mlr package that lists all the methods it supports for a given learner, which I have used once but cannot find again. I do recall that xgboost's xgb.create.feature was definitely on the included list, but I cannot find any docs on how to use it from within mlr. Does anyone know how to do this? (And if anyone can remember the name of the mlr search function for implemented learner methods that would also be much appreciated.)

1

There are 1 answers

0
ja-thomas On

xgb.create.features is a function from xgboost not mlr.

If you want to use the function, you can access the learner model directly and call the function.

library(mlr)
library(xgboost)

mod = train(makeLearner("classif.xgboost"), iris.task)
iris.dc = data.matrix(getTaskData(iris.task, target.extra = TRUE)$data)
xgboost::xgb.create.features(mod$learner.model, iris.dc)

Not all methods of learners are directly supported from mlr side.