Skip to content

Commit

Permalink
use @examplesIf where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
bblodfon committed Oct 15, 2024
1 parent 563108a commit 84a1536
Show file tree
Hide file tree
Showing 24 changed files with 37 additions and 16 deletions.
3 changes: 2 additions & 1 deletion R/learner_mboost_regr_gamboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
#' @export
#' @template seealso_learner
#' @examples
#' # Define the Learner
#' learner = lrn("regr.gamboost", baselearner = "bols")
#' learner
#' print(learner)
LearnerRegrGAMBoost = R6Class("LearnerRegrGAMBoost",
inherit = LearnerRegr,
public = list(
Expand Down
2 changes: 1 addition & 1 deletion R/learner_mgcv_classif_gam.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @references
#' `r format_bib("hastie2017generalized", "wood2012mgcv")`
#'
#' @examples
#' @examplesIf requireNamespace("mgcv", quietly = TRUE)
#' # simple example
#' t = mlr3::tsk("spam")$filter(1:1000)
#' l = mlr3::lrn("classif.gam")
Expand Down
3 changes: 1 addition & 2 deletions R/learner_mgcv_regr_gam.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#' @references
#' `r format_bib("hastie2017generalized", "wood2012mgcv")`
#'
#' @examples
#'
#' @examplesIf requireNamespace("mgcv", quietly = TRUE)
#' # simple example
#' t = mlr3::tsk("mtcars")
#' l = mlr3::lrn("regr.gam")
Expand Down
2 changes: 1 addition & 1 deletion R/learner_partykit_classif_mob.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @export
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("partykit", quietly = TRUE)
#' library(mlr3)
#' logit_ = function(y, x, start = NULL, weights = NULL, offset = NULL, ...) {
#' glm(y ~ 1, family = binomial, start = start, ...)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_partykit_regr_mob.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @export
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("partykit", quietly = TRUE)
#' library(mlr3)
#' lm_ = function(y, x, start = NULL, weights = NULL, offset = NULL, ...) {
#' lm(y ~ 1, ...)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_randomForestSRC_classif_imbalanced_rfsrc.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' `r format_bib("obrien2019imbrfsrc", "chen2004imbrf")`
#'
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("randomForestSRC", quietly = TRUE)
#' # Define the Learner
#' learner = mlr3::lrn("classif.imbalanced_rfsrc", importance = "TRUE")
#' print(learner)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_randomForestSRC_classif_rfsrc.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' `r format_bib("breiman_2001")`
#'
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("randomForestSRC", quietly = TRUE)
#' # Define the Learner
#' learner = mlr3::lrn("classif.rfsrc", importance = "TRUE")
#' print(learner)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_randomForestSRC_regr_rfsrc.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' `r format_bib("breiman_2001")`
#'
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("randomForestSRC", quietly = TRUE)
#' # Define the Learner
#' learner = mlr3::lrn("regr.rfsrc", importance = "TRUE")
#' print(learner)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_randomForestSRC_surv_rfsrc.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' `r format_bib("ishwaran_2008", "breiman_2001")`
#'
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("randomForestSRC", quietly = TRUE)
#' # Define the Learner
#' learner = mlr3::lrn("surv.rfsrc", importance = "TRUE")
#' print(learner)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_randomForest_classif_randomForest.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' `r format_bib("breiman_2001")`
#'
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("randomForest", quietly = TRUE)
#' # Define the Learner
#' learner = mlr3::lrn("classif.randomForest", importance = "accuracy")
#' print(learner)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_randomForest_regr_randomForest.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' `r format_bib("breiman_2001")`
#'
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("randomForest", quietly = TRUE)
#' # Define the Learner
#' learner = mlr3::lrn("regr.randomForest", importance = "mse")
#' print(learner)
Expand Down
2 changes: 1 addition & 1 deletion R/learner_ranger_surv_ranger.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' `r format_bib("wright_2017", "breiman_2001")`
#'
#' @template seealso_learner
#' @examples
#' @examplesIf requireNamespace("ranger", quietly = TRUE)
#' # Define the Learner
#' learner = mlr3::lrn("surv.ranger", importance = "permutation")
#' print(learner)
Expand Down
2 changes: 2 additions & 0 deletions man/mlr_learners_classif.gam.Rd

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

3 changes: 2 additions & 1 deletion man/mlr_learners_classif.imbalanced_rfsrc.Rd

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

2 changes: 2 additions & 0 deletions man/mlr_learners_classif.mob.Rd

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

2 changes: 2 additions & 0 deletions man/mlr_learners_classif.randomForest.Rd

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

2 changes: 2 additions & 0 deletions man/mlr_learners_classif.rfsrc.Rd

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

3 changes: 2 additions & 1 deletion man/mlr_learners_regr.gam.Rd

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

3 changes: 2 additions & 1 deletion man/mlr_learners_regr.gamboost.Rd

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

2 changes: 2 additions & 0 deletions man/mlr_learners_regr.mob.Rd

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

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

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

2 changes: 2 additions & 0 deletions man/mlr_learners_regr.rfsrc.Rd

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

2 changes: 2 additions & 0 deletions man/mlr_learners_surv.ranger.Rd

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

2 changes: 2 additions & 0 deletions man/mlr_learners_surv.rfsrc.Rd

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

0 comments on commit 84a1536

Please sign in to comment.