Skip to content

Commit

Permalink
Learner vignette (#141)
Browse files Browse the repository at this point in the history
* Fix vignette

* version

* Update learner table

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
sebffischer and github-actions[bot] authored Nov 24, 2021
1 parent 8129e2a commit 6d6657e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
10 changes: 5 additions & 5 deletions 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.16
Version: 0.5.17
Authors@R:
c(person(given = "Raphael",
family = "Sonabend",
Expand Down Expand Up @@ -34,10 +34,10 @@ Authors@R:
person(given = "Javier",
family = "García",
role = "ctb",
email = "[email protected]"),
person(given = "Sebastian",
family = "Fischer",
role = c("cre", "ctb"),
email = "[email protected]"),
person(given = "Sebastian",
family = "Fischer",
role = c("cre", "ctb"),
email = "[email protected]"))
Description: Extra learners for use in mlr3.
License: LGPL-3
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
60 changes: 45 additions & 15 deletions vignettes/learners/learner_status.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,45 @@ library(mlr3extralearners)
path = mlr3extralearners:::pkg_root(".")
tbl = list_mlr3learners(select = c("id", "required_packages", "mlr3_package"))
tbl[,Package := sapply(required_packages, function(x) x[1])]
tbl$required_packages = NULL
tbl$Author = apply(tbl, 1, function(row) {
remove_mlr3 = function(pkgs) {
pkgs = pkgs[!grepl("mlr3", pkgs)]
return(pkgs)
}
no_badges = c("CoxBoost", "catboost", "stats", "stats4")
make_badge = function(pkg) {
if (pkg %in% no_badges) return("")
paste0(sprintf("[![cran checks](https://cranchecks.info/badges/worst/%s)]", pkg),
sprintf("(https://cran.r-project.org/web/checks/check_results_%s.html)", pkg))
}
make_badges = function(pkgs) {
mlr3misc::map_chr(pkgs, make_badge)
}
upstream_pkgs = mlr3misc::map(tbl$required_packages, remove_mlr3)
upstream_status = upstream_pkgs |>
mlr3misc::map(make_badges) |>
mlr3misc::map_chr(function(x) mlr3misc::str_collapse(x, sep = "<br />"))
upstream_pkgs = upstream_pkgs |>
mlr3misc::map(function(x) mlr3misc::str_collapse(x, sep = "<br />"))
mlr3_pkgs = tbl$mlr3_package
#mlr3_status = mlr3_pkgs |>
# mlr3misc::map(make_badges)
tbl = tbl[, "id"]
tbl[["mlr3"]] = mlr3_pkgs
#tbl[["mlr3_status"]] = mlr3_status
tbl[["upstream"]] = upstream_pkgs
tbl[["upstream_status"]] = upstream_status
tbl$author = apply(tbl, 1, function(row) {
switch(row[[2]],
"mlr3extralearners" = {
x = readLines(file.path(path, "man", paste0("mlr_learners_", row[[1]], ".Rd")))
Expand All @@ -22,17 +58,11 @@ tbl$Author = apply(tbl, 1, function(row) {
)})
# edge cases
tbl[grepl("debug|featureless", id) & mlr3_package == "mlr3", "Package"] = "mlr3"
tbl[grepl("debug|featureless", id) & mlr3_package == "mlr3cluster", "Package"] = "mlr3cluster"
#tbl[grepl("debug|featureless", id) & mlr3 == "mlr3", "mlr3"] = "mlr3"
#tbl[grepl("debug|featureless", id) & mlr3 == "mlr3cluster", "mlr3"] = "mlr3cluster"
tbl = tbl[order(tbl, tolower(mlr3), id)]
colnames(tbl) = c("Key", "Package", "Upstream", "Upstream Status", "Author")
knitr::kable(tbl, "html", escape = FALSE)
tbl[,Status := ifelse(mlr3_package == "mlr3extralearners",
paste0("[![", Package, "](https://github.com/mlr-org/mlr3extralearners/workflows/", Package, "%20(ubuntu-latest,%20release)/badge.svg)](https://github.com/mlr-org/mlr3extralearners/actions?query=workflow%3A%22", Package, "+%28ubuntu-latest%2C+release%29%22)"),
paste0("[![", mlr3_package, "](https://github.com/mlr-org/",mlr3_package ,"/workflows/tic/badge.svg)](https://github.com/mlr-org/", mlr3_package,"/actions)"))]
tbl[,"Cran Status" := sprintf("[![cran checks](https://cranchecks.info/badges/worst/%s)](https://cran.r-project.org/web/checks/check_results_%s.html)",
Package, Package)]
colnames(tbl)[1:2] = c("Key", "mlr3 Package")
tbl = tbl[order(tbl, tolower(Package), Key), c(1, 2, 3, 5, 6, 4)]
knitr::kable(tbl, "pipe")
```

0 comments on commit 6d6657e

Please sign in to comment.