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

Add randomPlantedForest learners (classif, regr) #304

Merged
merged 33 commits into from
Nov 2, 2023

Conversation

jemus42
Copy link
Member

@jemus42 jemus42 commented Oct 17, 2023

This adds the randomPlantedForest learners for classification and regression.

I started this fork some time ago to use the learners in a benchmark and it's high time to make it official I guess.
There are still some things to do though:

  • Add myself to DESCRIPTION
  • Re-document once the roxygen2/srcref thing is fixed/there's a workaround
  • Wait for CI

@sebffischer
Copy link
Member

Install this branch for a hacky roxygen workaround: https://github.com/mlr-org/mlr3misc/tree/fix/document-leanify

@jemus42 jemus42 marked this pull request as ready for review October 18, 2023 11:14
R/learner_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
R/learner_randomPlantedForest_classif_rpf.R Show resolved Hide resolved
R/learner_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
R/learner_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
R/learner_randomPlantedForest_classif_rpf.R Show resolved Hide resolved
tests/testthat/test_randomPlantedForest_regr_rpf.R Outdated Show resolved Hide resolved
tests/testthat/test_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
Copy link
Member

@sebffischer sebffischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I have mostly some minor comments

Copy link
Member

@sebffischer sebffischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor things...

R/learner_randomPlantedForest_classif_rpf.R Show resolved Hide resolved
R/learner_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
@jemus42
Copy link
Member Author

jemus42 commented Oct 23, 2023

Thanks!

Okay, I think the only thing left is to figure out what to do about the custom parameters (#304 (comment)).

Copy link
Member

@sebffischer sebffischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor issues still left, lmk when you are confused about something.

R/learner_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
R/learner_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
#' The parameter `max_interaction_limit` can optionally be set as an upper bound, such that
#' `max_interaction_ratio * min(n_features, max_interaction_limit)` is used instead.
#' This is analogous to `mtry.ratio` in [`classif.ranger`][mlr3learners::mlr_learners_classif.ranger], with
#' `max_interaction_limit` as an additional constraint.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention that max_interaction_limit is initialized to Inf

R/learner_randomPlantedForest_classif_rpf.R Show resolved Hide resolved
R/learner_randomPlantedForest_classif_rpf.R Outdated Show resolved Hide resolved
R/learner_randomPlantedForest_regr_rpf.R Outdated Show resolved Hide resolved
jemus42 and others added 6 commits November 2, 2023 12:04
Co-authored-by: Sebastian Fischer <sebf.fischer@gmail.com>
Co-authored-by: Sebastian Fischer <sebf.fischer@gmail.com>
Co-authored-by: Sebastian Fischer <sebf.fischer@gmail.com>
Co-authored-by: Sebastian Fischer <sebf.fischer@gmail.com>
Co-authored-by: Sebastian Fischer <sebf.fischer@gmail.com>
param_set = ps(
max_interaction = p_int(lower = 0, upper = Inf, default = 1, tags = "train"),
max_interaction_ratio = p_dbl(lower = 0, upper = 1, tags = "train"),
max_interaction_limit = p_int(lower = 1, upper = Inf, tags = c("required", "train")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
max_interaction_limit = p_int(lower = 1, upper = Inf, tags = c("required", "train")),
max_interaction_limit = p_int(lower = 1, upper = Inf, tags = c("required", "train"), special_vals = list(Inf)),

Copy link
Member

@sebffischer sebffischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I broke something

R/learner_randomPlantedForest_regr_rpf.R Outdated Show resolved Hide resolved
@sebffischer sebffischer merged commit 0e81d4d into mlr-org:main Nov 2, 2023
4 checks passed
@jemus42 jemus42 deleted the rpf branch November 2, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants