diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 4ef5dd6..4406458 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -4,11 +4,9 @@ on: push: branches: - main - - master pull_request: branches: - main - - master name: R-CMD-check @@ -37,11 +35,12 @@ jobs: PYTORCH_MPS_HIGH_WATERMARK_RATIO: 0.0 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} + extra-repositories: "https://bgreenwell.r-universe.dev" - uses: r-lib/actions/setup-pandoc@v2 @@ -52,10 +51,11 @@ jobs: - uses: quarto-dev/quarto-actions/setup@v2 with: - version: 1.7.30 + version: 1.9.38 - uses: r-lib/actions/setup-r-dependencies@v2 with: + cache-version: 2 extra-packages: any::rcmdcheck, local::. needs: check diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 30e6ba8..9327aee 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -2,9 +2,11 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master] + branches: + - main pull_request: - branches: [main, master] + branches: + - main release: types: [published] workflow_dispatch: @@ -22,7 +24,7 @@ jobs: TORCH_INSTALL: 1 steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2 @@ -38,6 +40,7 @@ jobs: uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true + extra-repositories: "https://bgreenwell.r-universe.dev" - name: Setup R dependencies uses: r-lib/actions/setup-r-dependencies@v2 diff --git a/DESCRIPTION b/DESCRIPTION index 8710c49..72fc23d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tabnet Title: Fit 'TabNet' Models for Classification and Regression -Version: 0.9.0.9000 +Version: 0.9.1 Authors@R: c( person("Daniel", "Falbel", , "daniel@rstudio.com", role = "aut"), person(, "RStudio", role = "cph"), @@ -11,10 +11,11 @@ Authors@R: c( comment = c(ORCID = "0000-0002-5573-3952")) ) Description: Implements the 'TabNet' model by Sercan O. Arik et al. (2019) - with 'Coherent Hierarchical Multi-label - Classification Networks' by Giunchiglia et al. and - provides a consistent interface for fitting and creating predictions. - It's also fully compatible with the 'tidymodels' ecosystem. + with 'Coherent Hierarchical + Multi-label Classification Networks' by Giunchiglia et al. + and provides a consistent interface + for fitting and creating predictions. It's also fully compatible with + the 'tidymodels' ecosystem. License: MIT + file LICENSE URL: https://mlverse.github.io/tabnet/, https://github.com/mlverse/tabnet BugReports: https://github.com/mlverse/tabnet/issues @@ -62,11 +63,13 @@ Suggests: workflows, xgboost, yardstick -VignetteBuilder: knitr +VignetteBuilder: + knitr +Additional_repositories: https://bgreenwell.r-universe.dev +Config/roxygen2/version: 8.0.0 Config/testthat/edition: 3 Config/testthat/parallel: false Config/testthat/start-first: interface, explain, params Encoding: UTF-8 -Roxygen: list(markdown = TRUE) Language: en-US -Config/roxygen2/version: 8.0.0 +Roxygen: list(markdown = TRUE) diff --git a/NEWS.md b/NEWS.md index 3e5c8c9..d30e073 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,6 @@ -# tabnet (development version) +# tabnet 0.9.1 + +* {vip} is now distributed from r-universe. # tabnet 0.9.0 diff --git a/R/hardhat.R b/R/hardhat.R index 1a60955..d2b74aa 100644 --- a/R/hardhat.R +++ b/R/hardhat.R @@ -471,7 +471,6 @@ predict.tabnet_fit <- function(object, new_data, type = NULL, ..., epoch = NULL) } #' @export -#' @inheritParams predict.tabnet_fit #' @rdname predict.tabnet_fit augment.tabnet_fit <- function(x, new_data, ...) { res <- predict(x, new_data, ...) diff --git a/README.md b/README.md index 078e0ae..6279afd 100644 --- a/README.md +++ b/README.md @@ -106,16 +106,16 @@ augment(fit, test) %>% #> # A tibble: 3 × 3 #> .metric .estimator .estimate #> -#> 1 accuracy binary 0.847 -#> 2 precision binary 0.853 -#> 3 recall binary 0.992 +#> 1 accuracy binary 0.837 +#> 2 precision binary 0.845 +#> 3 recall binary 0.988 augment(fit, test, type = "prob") %>% roc_auc(Attrition, .pred_No) #> # A tibble: 1 × 3 #> .metric .estimator .estimate #> -#> 1 roc_auc binary 0.384 +#> 1 roc_auc binary 0.461 ``` ## Explain model on test-set with attention map diff --git a/cran-comments.md b/cran-comments.md index 0636d49..c05203a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -4,4 +4,4 @@ * This is a new release. -Note 1 : Example duration is inherent to fitting a model with the underlying torch framework. +Note 1 : vip package in Suggests has been moved to an Additional repository specification. diff --git a/inst/WORDLIST b/inst/WORDLIST index c9d5762..6e25989 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -29,6 +29,7 @@ autoassociative autograd beeing callout +checkpointing classif cli cpu @@ -42,6 +43,7 @@ et explainability extensibility ggplot +mps mse nn num @@ -60,4 +62,5 @@ th tibble tidymodels tunable +vip zeallot diff --git a/man/figures/README-model-explain-1.png b/man/figures/README-model-explain-1.png index 5487b48..5ce8e32 100644 Binary files a/man/figures/README-model-explain-1.png and b/man/figures/README-model-explain-1.png differ diff --git a/man/figures/README-model-fit-1.png b/man/figures/README-model-fit-1.png index 0cde550..54d593b 100644 Binary files a/man/figures/README-model-fit-1.png and b/man/figures/README-model-fit-1.png differ diff --git a/man/figures/README-step-explain-1.png b/man/figures/README-step-explain-1.png index 3939dd7..718ac91 100644 Binary files a/man/figures/README-step-explain-1.png and b/man/figures/README-step-explain-1.png differ diff --git a/man/figures/README-step-pretrain-1.png b/man/figures/README-step-pretrain-1.png index 269fe9e..9dc040e 100644 Binary files a/man/figures/README-step-pretrain-1.png and b/man/figures/README-step-pretrain-1.png differ diff --git a/tests/testthat/test-parsnip.R b/tests/testthat/test-parsnip.R index f322bcb..5dc63ae 100644 --- a/tests/testthat/test-parsnip.R +++ b/tests/testthat/test-parsnip.R @@ -109,12 +109,15 @@ test_that("Check we can finalize a workflow from a tune_grid", { cv_folds <- small_ames %>% rsample::vfold_cv(v = 2, repeats = 1) - at <- tune::tune_grid( + expect_warning( + at <- tune::tune_grid( object = wf, resamples = cv_folds, grid = custom_grid, metrics = yardstick::metric_set(yardstick::rmse), control = tune::control_grid(verbose = F) + ), + regexp = "No tuning parameters" ) best_rmse <- tune::select_best(at, metric = "rmse") diff --git a/vignettes/Hierarchical_classification.Rmd b/vignettes/Hierarchical_classification.Rmd index 20c8b5a..7c4298b 100644 --- a/vignettes/Hierarchical_classification.Rmd +++ b/vignettes/Hierarchical_classification.Rmd @@ -13,6 +13,7 @@ knitr::opts_chunk$set( comment = "#>", eval = FALSE ) +requireNamespace("vip", quietly = TRUE) ``` ```{r setup} diff --git a/vignettes/Missing_data_predictors.Rmd b/vignettes/Missing_data_predictors.Rmd index 31ae6d9..753444d 100644 --- a/vignettes/Missing_data_predictors.Rmd +++ b/vignettes/Missing_data_predictors.Rmd @@ -15,6 +15,7 @@ knitr::opts_chunk$set( comment = "#>", eval = FALSE ) +requireNamespace("vip", quietly = TRUE) ``` # Motivation @@ -124,7 +125,7 @@ col_with_missings <- ames_missing %>% rename(has_missing = "value") vip_color <- function(object, col_has_missing) { - vip_data <- vip::vip(object)$data %>% arrange(Importance) + vip_data <- vip::vi(object) %>% arrange(Importance) vis_miss_plus <- left_join(vip_data, col_has_missing , by = "Variable") %>% mutate(Variable = factor(Variable, levels = vip_data$Variable)) vis_miss_plus diff --git a/vignettes/interpretation.Rmd b/vignettes/interpretation.Rmd index fd69ed7..1a797ee 100644 --- a/vignettes/interpretation.Rmd +++ b/vignettes/interpretation.Rmd @@ -19,6 +19,7 @@ knitr::opts_chunk$set( out.height = "300px", fig.width = 14 ) +requireNamespace("vip", quietly = TRUE) ``` ```{r setup}