mlr3filters icon indicating copy to clipboard operation
mlr3filters copied to clipboard

Boruta filter in mlr3 returns different results from the Boruta function in Boruta package.

Open MOKA1066 opened this issue 10 months ago • 0 comments

It seems that the Boruta filter in mlr3 filters uses Boruta package, why they return different results?

Here is code:

# the Boruta filter in mlr3
library(mlr3)
library(mlr3filters)
task = mlr3::tsk("sonar")
filter = flt("boruta")
set.seed(12)
filter$calculate(task)
res1 = as.data.table(filter) |> 
    as_tibble() |> 
    dplyr::filter(score == 1)

# the Boruta function in Boruta package
library(Boruta)
set.seed(12)
var.sel = Boruta(Class ~ ., data = tsk("sonar")$data())
res2 = tibble(feature = names(var.sel$finalDecision), status = var.sel$finalDecision) |> dplyr::filter(status == "Confirmed")

# check the difference
setdiff(res1$feature, res2$feature)

MOKA1066 avatar Dec 30 '24 13:12 MOKA1066