Skip to content

Commit

Permalink
fix: randomForest feature types
Browse files Browse the repository at this point in the history
  • Loading branch information
sebffischer authored Sep 23, 2022
1 parent 390f239 commit 140eba3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rcmdcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
install.packages("pak")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mlr3extralearners
Title: Extra Learners For mlr3
Version: 0.5.48-9000
Version: 0.5.49
Authors@R: c(
person("Raphael", "Sonabend", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-9225-4654")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# mlr3extralearners 0.5.49

* Added missing feature type `"integer"` to `classif.randomForest`
* Added missing feature type `"logical"` to {classif, regr}.randomForest

# mlr3extralearners 0.5.48

* Add rsm learner
Expand Down
2 changes: 1 addition & 1 deletion R/learner_obliqueRSF_surv_obliqueRSF.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ delayedAssign(
#' Creates a new instance of this [R6][R6::R6Class] class.
initialize = function() {

warning("obliqueRSF has been superseded by aorsf. We highly recommend you use aorsf to fit oblique random survival forests: see https://github.com/bcjaeger/aorsf or install from CRAN with install.packages('aorsf')",
messagef("obliqueRSF has been superseded by aorsf. We highly recommend you use aorsf to fit oblique random survival forests: see https://github.com/bcjaeger/aorsf or install from CRAN with install.packages('aorsf')",
call. = FALSE)

ps = ps(
Expand Down
4 changes: 2 additions & 2 deletions R/learner_randomForest_classif_randomForest.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ LearnerClassifRandomForest = R6Class("LearnerClassifRandomForest",
tags = "train"),
maxnodes = p_int(lower = 1L, tags = "train"),
importance = p_fct(default = FALSE,
levels = c("accuracy", "gini", "none", FALSE),
levels = c("accuracy", "gini", "none"),
special_vals = list(FALSE),
tags = "train"),
localImp = p_lgl(default = FALSE, tags = "train"),
Expand All @@ -52,7 +52,7 @@ LearnerClassifRandomForest = R6Class("LearnerClassifRandomForest",
super$initialize(
id = "classif.randomForest",
packages = c("mlr3extralearners", "randomForest"),
feature_types = c("numeric", "factor", "ordered"),
feature_types = c("integer", "numeric", "factor", "ordered", "logical"),
predict_types = c("response", "prob"),
param_set = ps,
properties = c("weights", "twoclass", "multiclass", "importance", "oob_error"),
Expand Down
4 changes: 2 additions & 2 deletions R/learner_randomForest_regr_randomForest.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LearnerRegrRandomForest = R6Class("LearnerRegrRandomForest",
tags = "train"),
maxnodes = p_int(lower = 1L, tags = "train"),
importance = p_fct(default = FALSE,
levels = c("mse", "nudepurity", "none", FALSE),
levels = c("mse", "nudepurity", "none"),
special_vals = list(FALSE),
tags = "train"),
localImp = p_lgl(default = FALSE, tags = "train"),
Expand All @@ -51,7 +51,7 @@ LearnerRegrRandomForest = R6Class("LearnerRegrRandomForest",
super$initialize(
id = "regr.randomForest",
packages = c("mlr3extralearners", "randomForest"),
feature_types = c("integer", "numeric", "factor", "ordered"),
feature_types = c("integer", "numeric", "factor", "ordered", "logical"),
predict_types = c("response"),
param_set = ps,
properties = c("weights", "importance", "oob_error"),
Expand Down
4 changes: 2 additions & 2 deletions man/mlr_learners_classif.randomForest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/mlr_learners_regr.randomForest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 140eba3

Please sign in to comment.