forked from mlr-org/mlr3extralearners
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
84 lines (68 loc) · 3.31 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
cache = FALSE,
collapse = TRUE,
comment = "#>",
echo = TRUE
)
library(mlr3extralearners)
library(magrittr)
```
# mlr3extralearners
Package website: [release](https://mlr3extralearners.mlr-org.com/) | [dev](https://mlr3extralearners.mlr-org.com/dev/)
Extra Learners for **[mlr3](https://github.com/mlr-org/mlr3/)**.
<!-- badges: start -->
[](https://mlr3extralearners.mlr-org.com/articles/learners/learner_status.html)
[](https://codecov.io/gh/mlr-org/mlr3extralearners)
[](https://stackoverflow.com/questions/tagged/mlr3)
[](https://www.codefactor.io/repository/github/mlr-org/mlr3extralearners)
<!-- badges: end -->
## What is mlr3extralearners?
`mlr3extralearners` contains all learners from mlr3 that are not in `mlr3learners` or the
core packages. `mlr3extralearners` contains helper functions to find where all the learners, across the mlr3verse, live and to install required packages to run these learners. See the interactive [learner list](https://mlr3extralearners.mlr-org.com/articles/learners/list_learners.html) for the full list of learners in the mlr3verse and the [learner status page](https://mlr3extralearners.mlr-org.com/articles/learners/learner_status.html) for a live build status.
```{r}
list_mlr3learners(select = c("id", "mlr3_package", "required_packages"))
```
mlr3extralearners lives on GitHub and will not be on CRAN. Install with:
```{r, eval = FALSE}
remotes::install_github("mlr-org/mlr3extralearners")
```
## Installing and Loading Learners
The package includes functionality for detecting if you have the required packages installed
to use a learner, and ships with the function `install_learner` which can install all required
learner dependencies.
```{r, echo=FALSE, results='hide',error=TRUE,message=FALSE,warning=FALSE}
remove.packages("gbm")
unloadNamespace("gbm")
```
```{r,error=TRUE}
lrn("regr.gbm")
```
```{r, results='hide',error=TRUE,message=FALSE,warning=FALSE}
install_learners("regr.gbm")
```
```{r}
lrn("regr.gbm")
```
## Extending mlr3extralearners
New learners can be created with the `create_learner` function. This assumes you have a local
copy of `mlr3extralearners`. This function will automatically create the learner, learner tests, parameter tests, YAML files for CI if required, and update the DESCRIPTION if required.
Once all tests are passing locally, open a [pull request](https://github.com/mlr-org/mlr3extralearners/pulls) with the "New Learner" template.
```{r, eval=FALSE}
create_learner(classname = "Locfit",
algorithm = "localised fit",
type = "dens",
key = "locfit",
package = "locfit",
caller = "density.lf",
feature_types = c("integer", "numeric"),
predict_types = c("pdf", "cdf"),
properties = NULL,
importance = FALSE,
oob_error = FALSE,
references = FALSE,
gh_name = "RaphaelS1")
```