From b68e8f4cd2ca71684b1fdf30f80fdf2c9de96e23 Mon Sep 17 00:00:00 2001 From: "Marvin N. Wright" Date: Tue, 5 Nov 2024 08:44:48 +0100 Subject: [PATCH 1/3] remove BEST dependency --- DESCRIPTION | 5 ++--- NEWS.md | 3 +++ R/cpi.R | 15 +++++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2240a45..1ff84f4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: cpi Type: Package Title: Conditional Predictive Impact -Version: 0.1.4 -Date: 2022-03-02 +Version: 0.1.5 +Date: 2024-11-05 Authors@R: c(person(given = "Marvin N.", family = "Wright", @@ -28,7 +28,6 @@ URL: https://github.com/bips-hb/cpi, BugReports: https://github.com/bips-hb/cpi/issues Imports: foreach, mlr3, lgr, knockoff Suggests: - BEST, mlr3learners, ranger, glmnet, diff --git a/NEWS.md b/NEWS.md index 84ec92b..bbe22c6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,7 @@ +# cpi 0.1.5 +* Remove BEST dependency (removed from CRAN) + # cpi 0.1.4 * Reset options() in vignette diff --git a/R/cpi.R b/R/cpi.R index 9e3ed6e..e81afec 100644 --- a/R/cpi.R +++ b/R/cpi.R @@ -176,10 +176,12 @@ cpi <- function(task, learner, stop("Unknown test in 'test' argument.") } if (test == "bayes") { - if (!requireNamespace("BEST", quietly = TRUE)) { - stop("Package \"BEST\" needed for Bayesian testing. Please install it.", - call. = FALSE) - } + # if (!requireNamespace("BEST", quietly = TRUE)) { + # stop("Package \"BEST\" needed for Bayesian testing. Please install it.", + # call. = FALSE) + # } + stop("Bayesian testing currently not implemented as BEST package was removed from CRAN.", + call. = FALSE) } if (task$task_type == "classif" & measure$id %in% c("classif.logloss", "classif.bbrier")) { @@ -309,8 +311,9 @@ cpi <- function(task, learner, res$p.value <- (sum(perm_means >= orig_mean) + 1)/(B + 1) res$ci.lo <- orig_mean - quantile(perm_means, 1 - alpha) } else if (test == "bayes") { - res <- list(BEST::BESTmcmc(dif, parallel = FALSE, verbose = FALSE)) - names(res) <- task$feature_names[i] + #res <- list(BEST::BESTmcmc(dif, parallel = FALSE, verbose = FALSE)) + #names(res) <- task$feature_names[i] + message("Bayesian testing currently not implemented as BEST package was removed from CRAN.") } else if (test %in% c('t', 'wilcox', 'binom')) { if (test == "t") { test_result <- t.test(dif, alternative = 'greater', From 2151384c31aaa516081f701f4e11c92eb2423d5f Mon Sep 17 00:00:00 2001 From: "Marvin N. Wright" Date: Tue, 5 Nov 2024 08:49:31 +0100 Subject: [PATCH 2/3] remove Boston housing task, fix #15 --- tests/testthat/test-check_args.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-check_args.R b/tests/testthat/test-check_args.R index cc16495..c44fcfd 100644 --- a/tests/testthat/test-check_args.R +++ b/tests/testthat/test-check_args.R @@ -51,9 +51,9 @@ test_that("fails for wrong groups", { "Feature numbers in argument 'groups' not in 1:p, where p is the number of features.") }) -test_that("fails with Gaussian knockoffs and factors", { - expect_error(cpi(task = tsk("boston_housing"), - learner = lrn("regr.lm"), - resampling = rsmp("holdout")), - "Gaussian knockoffs cannot handle factor features\\. Consider using sequential knockoffs \\(see examples\\) or recoding factors\\.") -}) +# test_that("fails with Gaussian knockoffs and factors", { +# expect_error(cpi(task = tsk("ames_housing"), +# learner = lrn("regr.lm"), +# resampling = rsmp("holdout")), +# "Gaussian knockoffs cannot handle factor features\\. Consider using sequential knockoffs \\(see examples\\) or recoding factors\\.") +# }) From 9fcdd8a2929c6fa2c3afdc29c0d01c9691c9bc2e Mon Sep 17 00:00:00 2001 From: "Marvin N. Wright" Date: Tue, 5 Nov 2024 09:57:10 +0100 Subject: [PATCH 3/3] update github actions --- .github/workflows/check-standard.yaml | 34 +++++++++++---------------- README.md | 1 + 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check-standard.yaml b/.github/workflows/check-standard.yaml index 0528262..d46a617 100644 --- a/.github/workflows/check-standard.yaml +++ b/.github/workflows/check-standard.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -6,7 +6,9 @@ on: pull_request: branches: [main, master] -name: R-CMD-check +name: R-CMD-check.yaml + +permissions: read-all jobs: R-CMD-check: @@ -18,7 +20,7 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} + - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} @@ -29,30 +31,22 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: rcmdcheck - - - uses: r-lib/actions/check-r-package@v1 - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash + extra-packages: any::rcmdcheck + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/README.md b/README.md index 91f2a3e..1035495 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![R-CMD-check](https://github.com/bips-hb/cpi/workflows/R-CMD-check/badge.svg)](https://github.com/bips-hb/cpi/actions) +[![check-standard](https://github.com/bips-hb/cpi/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/bips-hb/cpi/actions/workflows/check-standard.yaml) ## Conditional Predictive Impact