Skip to content

Commit

Permalink
rcmdcheck passing
Browse files Browse the repository at this point in the history
  • Loading branch information
sebffischer committed Jul 15, 2024
1 parent 3c7cdf1 commit cb60be5
Show file tree
Hide file tree
Showing 26 changed files with 74 additions and 34 deletions.
26 changes: 26 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
^README.html$
^README\.Rmd$
^LICENSE$
^README.html$
^README\.Rmd$
^.*\.Rproj$
^\.Rproj\.user$
^\.ccache$
^\.editorconfig$
^\.git$
^\.github$
^\.github$
^\.gitignore$
^\.ignore$
^\.lintr$
^\.vscode$
^docs$
^inst/extdata/.+\.R$
^man-roxygen$
^paper$
^pkgdown$
^revdep$
^CITATION.cff$
^CONTRIBUTING.md
^cran-comments\.md$
^CRAN-SUBMISSION$
12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Depends:
mlr3
Imports:
data.table,
future,
mlr3misc,
paradox,
checkmate,
lgr,
withr,
R6
Remotes:
mlr-org/mlr3@feat/loss_funs,
Expand All @@ -29,13 +31,13 @@ Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Collate:
'aaa.R'
'MeasureAbstractCi.R'
'aaa.R'
'MeasureCIConZ.R'
'MeasureCICorT.R'
'MeasureCIHoldout.R'
'MeasureCINaiveCV.R'
'MeasureCi.R'
'MeasureCiConZ.R'
'MeasureCiCorT.R'
'MeasureCiHoldout.R'
'MeasureCiNaiveCV.R'
'MeasureCiNestedCV.R'
'ResamplingNestedCV.R'
'ResamplingPairedSubsampling.R'
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ import(mlr3misc)
import(paradox)
importFrom(R6,R6Class)
importFrom(R6,is.R6)
importFrom(stats,qnorm)
importFrom(stats,qt)
importFrom(stats,sd)
importFrom(stats,var)
importFrom(utils,bibentry)
1 change: 1 addition & 0 deletions R/MeasureCIConZ.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ MeasureCiConZ = R6Class("MeasureCiConZ",
)
)

#' @include aaa.R
measures[["ci.con_z"]] = list(MeasureCiConZ, .prototype_args = list(measure = "classif.acc"))
1 change: 1 addition & 0 deletions R/MeasureCICorT.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ MeasureCiCorrectedT = R6Class("MeasureCiCorrectedT",
)
)

#' @include aaa.R
measures[["ci.cor_t"]] = list(MeasureCiCorrectedT, .prototype_args = list(measure = "classif.acc"))
1 change: 1 addition & 0 deletions R/MeasureCIHoldout.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ MeasureCiHoldout = R6Class("MeasureCiHoldout",
)
)

#' @include aaa.R
measures[["ci.holdout"]] = list(MeasureCiHoldout, .prototype_args = list(measure = "classif.acc"))
3 changes: 2 additions & 1 deletion R/MeasureCINaiveCV.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @examples
#' m_naivecv = msr("ci.naive_cv", "classif.ce")
#' m_naivecv
#' rr = resample(tsk("sonar"), lrn("classif.featureless"), m_naivecv)
#' rr = resample(tsk("sonar"), lrn("classif.featureless"), rsmp("cv"))
#' rr$aggregate(m_naivecv)
MeasureCiNaiveCV = R6Class("MeasureCiNaiveCV",
inherit = MeasureAbstractCi,
Expand Down Expand Up @@ -59,4 +59,5 @@ MeasureCiNaiveCV = R6Class("MeasureCiNaiveCV",
)
)

#' @include aaa.R
measures[["ci.naive_cv"]] = list(MeasureCiNaiveCV, .prototype_args = list(measure = "classif.acc"))
5 changes: 3 additions & 2 deletions R/MeasureCi.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#' The desired alpha level.
#' @export
#' @examples
#' rr = resample(tsk("sonar"), rsmp("classif.featureless"), rsmp("holdout"))
#' rr = resample(tsk("sonar"), lrn("classif.featureless"), rsmp("holdout"))
#' rr$aggregate(msr("ci", "classif.acc"))
#' # is the same as:
#' rr$aggregate(msr("ci.holdout", "classif.acc")
#' rr$aggregate(msr("ci.holdout", "classif.acc"))
MeasureCi = R6Class("Measure",
inherit = MeasureAbstractCi,
public = list(
Expand Down Expand Up @@ -43,4 +43,5 @@ MeasureCi = R6Class("Measure",
)
)

#' @include aaa.R
measures[["ci"]] = list(MeasureCi, .prototype_args = list(measure = "classif.acc"))
1 change: 1 addition & 0 deletions R/MeasureCiNestedCV.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ MeasureCiNestedCV = R6Class("MeasureCiNestedCV",
)
)

#' @include aaa.R
measures[["ci.ncv"]] = list(MeasureCiNestedCV, .prototype_args = list(measure = "classif.acc"))
7 changes: 4 additions & 3 deletions R/ResamplingNestedCV.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
#' @references
#' `r format_bib("bates2024cross")`
#' @examples
#' ncv = rsmp("nested_cv", folds = 2, repeats = 10L)
#' ncv = rsmp("nested_cv", folds = 3, repeats = 10L)
#' ncv
#' rr = resample(tsk("mtcars"), lrn("classif.featureless"), ncv)
#' rr = resample(tsk("mtcars"), lrn("regr.featureless"), ncv)
ResamplingNestedCV = R6::R6Class("ResamplingNestedCV",
inherit = mlr3::Resampling,
public = list(
#' @description
#' Creates a new instance of this [R6][R6::R6Class] class.
initialize = function() {
param_set = ps(
folds = p_int(lower = 1L, tags = "required"),
folds = p_int(lower = 2L, tags = "required"),
repeats = p_int(lower = 1L, tags = "required")
)

Expand Down Expand Up @@ -127,4 +127,5 @@ ResamplingNestedCV = R6::R6Class("ResamplingNestedCV",
)
)

#' @include aaa.R
resamplings[["nested_cv"]] = ResamplingNestedCV
5 changes: 2 additions & 3 deletions R/ResamplingPairedSubsampling.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
#' `r format_bib("nadeau1999inference")`
#' @export
#' @examples
#' # cheap parameterization to run quickly:
#' pw_subs = rsmp("paired_subsampling", repeats_in = 2, repeats_out = 3L)
#' pw_subs = rsmp("paired_subsampling")
#' pw_subs
#' rr = resample(tsk("sonar"), lrn("classif.featureless"), pw_subs)
ResamplingPairedSubsampling = R6Class("ResamplingPairedSubsampling",
inherit = mlr3::Resampling,
public = list(
Expand Down Expand Up @@ -149,4 +147,5 @@ ResamplingPairedSubsampling = R6Class("ResamplingPairedSubsampling",
)
)

#' @include aaa.R
resamplings[["paired_subsampling"]] = ResamplingPairedSubsampling
5 changes: 5 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
#' @import data.table
#' @import mlr3misc
#' @importFrom R6 R6Class is.R6
#' @importFrom stats qnorm qt sd var
#' @import mlr3
"_PACKAGE"

register_mlr3 = function(...) {
assign("lg", lgr::get_logger("mlr3"), envir = parent.env(environment()))
# static checker
future::plan
withr::with_seed

if (Sys.getenv("IN_PKGDOWN") == "true") {
lg$set_threshold("warn")
}
Expand Down
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ knitr::opts_chunk$set(
)
library(mlr3)
library(mlr3misc)
set.seed(1)
lgr::get_logger("mlr3")$set_threshold("warn")
```

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ rr = resample(tsk("sonar"), lrn("classif.rpart"), rsmp("holdout"))
ci = msr("ci.holdout", "classif.acc")
rr$aggregate(ci)
#> classif.acc classif.acc.lower classif.acc.upper
#> 0.6086957 0.4926975 0.7246938
#> 0.7391304 0.6347628 0.8434981
```

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

> \[!NOTE\]
Expand Down
4 changes: 0 additions & 4 deletions TODOs.md

This file was deleted.

1 change: 1 addition & 0 deletions man/figures/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/logo_orig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cb60be5

Please sign in to comment.