Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Forest minimal depth filter returns all NA's #2710

Closed
annette987 opened this issue Jan 8, 2020 · 2 comments · Fixed by #2713
Closed

Random Forest minimal depth filter returns all NA's #2710

annette987 opened this issue Jan 8, 2020 · 2 comments · Fixed by #2713
Labels

Comments

@annette987
Copy link

The random forest minimal depth filter is returning all NA values. This is because the vector of features returned by the filter is not a named vector and generateFilterValuesData expects a named vector. I can submit a PR to fix this and it will explain the solution.

library(survival)
library(mlr)
#> Loading required package: ParamHelpers
#> 'mlr' is in maintenance mode since July 2019. Future development
#> efforts will go into its successor 'mlr3' (<https://mlr3.mlr-org.com>).

set.seed(24601)
data(veteran)
mas.task <- makeSurvTask(id = "VET", data = veteran, target = c("time", "status"))
outer = makeResampleDesc("CV", iters = 2, stratify = TRUE)

cox.filt.mindepth.lrn = makeFilterWrapper(
    makeLearner(cl = "surv.coxph", id = "cox.filt.mindepth", predict.type = "response"), 
    fw.method = "randomForestSRC_var.select",
    fw.abs = 5,
    more.args = list("randomForestSRC_var.select" = list("metho" = "md", ntree=100, nsplit = 10, nodesize = 3))
  )

learners = list(cox.filt.mindepth.lrn)   
bmr = benchmark(learners, mas.task, outer, show.info = TRUE)
#> Task: VET, Learner: cox.filt.mindepth.filtered
#> Resampling: cross-validation
#> Measures:             cindex
#> Error in (function (task, method = "randomForestSRC_importance", fval = NULL, : Filter method returned all NA values!

Created on 2020-01-08 by the reprex package (v0.3.0)

@pat-s
Copy link
Member

pat-s commented Jan 8, 2020

A PR including a test for this would be great!
It sounds this only applies to this specific filter method, correct?

@annette987
Copy link
Author

Yes that's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants