forked from mlr-org/mlr3extralearners
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_learner_table.R
19 lines (18 loc) · 911 Bytes
/
build_learner_table.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
library(mlr3)
library(mlr3learners)
library(mlr3extralearners)
library(mlr3proba)
library(mlr3cluster)
keys = mlr3::mlr_learners$keys()
all_lrns = suppressWarnings(mlr3::lrns(keys))
mlr3learners_table = data.table::data.table(t(data.table::rbindlist(list(
mlr3misc::map(all_lrns, function(.x) {
idsplt = strsplit(.x$id, ".", TRUE)[[1]]
list(idsplt[[2]], idsplt[[1]], .x$id, strsplit(.x$man, "::", TRUE)[[1]][1],
.x$packages, .x$properties, .x$feature_types, .x$predict_types)
})))))
colnames(mlr3learners_table) = c("name", "class", "id", "mlr3_package", "required_packages",
"properties", "feature_types", "predict_types")
mlr3learners_table[, 1:4] = lapply(mlr3learners_table[, 1:4], as.character)
mlr3learners_table[mlr3learners_table$class == "clust", "mlr3_package"] = "mlr3cluster"
usethis::use_data(mlr3learners_table, internal = TRUE, overwrite = TRUE)