Skip to content

Commit

Permalink
readme, website, chores
Browse files Browse the repository at this point in the history
  • Loading branch information
sebffischer committed Jul 18, 2024
1 parent 4986faf commit abb363f
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true

[*.{r,R,md,Rmd}]
indent_size = 2

[*.{c,h}]
indent_size = 4

[*.{cpp,hpp}]
indent_size = 4

[{NEWS.md,DESCRIPTION,LICENSE}]
max_line_length = 80
10 changes: 10 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
linters: linters_with_defaults(
# lintr defaults: https://lintr.r-lib.org/reference/default_linters.html
# the following setup changes/removes certain linters
assignment_linter = NULL, # do not force using <- for assignments
object_name_linter = object_name_linter(c("snake_case", "CamelCase")), # only allow snake case and camel case object names
cyclocomp_linter = NULL, # do not check function complexity
commented_code_linter = NULL, # allow code in comments
line_length_linter = line_length_linter(120L),
object_length_linter = object_length_linter(40L)
)
19 changes: 18 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lgr::get_logger("mlr3")$set_threshold("warn")

Statistical inference methods for {mlr3}.

Package website: [dev](https://mlr3inference.mlr-org.com/dev/)
[Package website](https://mlr3inference.mlr-org.com/)

<!-- badges: start -->
[![RCMD Check](https://github.com/mlr-org/mlr3inference/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/mlr-org/mlr3inference/actions/workflows/r-cmd-check.yml)
Expand Down Expand Up @@ -63,6 +63,23 @@ ci_default = msr("ci", "classif.acc")
rr$aggregate(ci_default)
```

With [`mlr3viz`](https://mlr3viz.mlr-org.com), it is also possible to visualize multiple confidence intervals.
Below, we compare a random forest with a decision tree and a featureless learner:


```{r, dpi = 300, out.width = "70%", fig.align = "center"}
library(mlr3learners)
library(mlr3viz)
bmr = benchmark(benchmark_grid(
tsks(c("sonar", "german_credit")),
lrns(c("classif.rpart", "classif.ranger", "classif.featureless")),
rsmp("subsampling")
))
autoplot(bmr, "ci", msr("ci", "classif.ce"))
```

Note that:

* Confidence Intervals can only be obtained for measures that are based on pointwise loss functions, i.e. have an `$obs_loss` field.
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ rr = resample(tsk("sonar"), lrn("classif.rpart"), rsmp("holdout"))
# 0.05 is also the default
ci = msr("ci.holdout", "classif.acc", alpha = 0.05)
rr$aggregate(ci)
#> classif.acc classif.acc.lower classif.acc.upper
#> 0.7391304 0.6347628 0.8434981
```

It is also possible to select the default inference method for a certain
Expand All @@ -48,8 +50,29 @@ It is also possible to select the default inference method for a certain
``` r
ci_default = msr("ci", "classif.acc")
rr$aggregate(ci_default)
#> classif.acc classif.acc.lower classif.acc.upper
#> 0.7391304 0.6347628 0.8434981
```

With [`mlr3viz`](https://mlr3viz.mlr-org.com), it is also possible to
visualize multiple confidence intervals. Below, we compare a random
forest with a decision tree and a featureless learner:

``` r
library(mlr3learners)
library(mlr3viz)

bmr = benchmark(benchmark_grid(
tsks(c("sonar", "german_credit")),
lrns(c("classif.rpart", "classif.ranger", "classif.featureless")),
rsmp("subsampling")
))

autoplot(bmr, "ci", msr("ci", "classif.ce"))
```

<img src="man/figures/README-unnamed-chunk-5-1.png" width="70%" style="display: block; margin: auto;" />

Note that:

- Confidence Intervals can only be obtained for measures that are based
Expand Down
Binary file added man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ navbar:
href: https://lmmisld-lmu-stats-slds.srv.mwn.de/mlr_invite/
github:
icon: fa fa-github
href: https://github.com/mlr-org/mlr3fda
href: https://github.com/mlr-org/mlr3inference
book:
text: mlr3book
icon: fa fa-link
Expand Down

0 comments on commit abb363f

Please sign in to comment.