Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

name: R-CMD-check

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
19 changes: 11 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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"),
Expand All @@ -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)
<doi:10.48550/arXiv.1908.07442> with 'Coherent Hierarchical Multi-label
Classification Networks' by Giunchiglia et al. <doi:10.48550/arXiv.2010.10151> and
provides a consistent interface for fitting and creating predictions.
It's also fully compatible with the 'tidymodels' ecosystem.
<doi:10.48550/arXiv.1908.07442> with 'Coherent Hierarchical
Multi-label Classification Networks' by Giunchiglia et al.
<doi:10.48550/arXiv.2010.10151> 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
Expand Down Expand Up @@ -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)
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# tabnet (development version)
# tabnet 0.9.1

* {vip} is now distributed from r-universe.

# tabnet 0.9.0

Expand Down
1 change: 0 additions & 1 deletion R/hardhat.R
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ augment(fit, test) %>%
#> # A tibble: 3 × 3
#> .metric .estimator .estimate
#> <chr> <chr> <dbl>
#> 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
#> <chr> <chr> <dbl>
#> 1 roc_auc binary 0.384
#> 1 roc_auc binary 0.461
```

## Explain model on test-set with attention map
Expand Down
3 changes: 3 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ autoassociative
autograd
beeing
callout
checkpointing
classif
cli
cpu
Expand All @@ -42,6 +43,7 @@ et
explainability
extensibility
ggplot
mps
mse
nn
num
Expand All @@ -60,4 +62,5 @@ th
tibble
tidymodels
tunable
vip
zeallot
Binary file modified man/figures/README-model-explain-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-model-fit-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-step-explain-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-step-pretrain-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion tests/testthat/test-parsnip.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions vignettes/Hierarchical_classification.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ knitr::opts_chunk$set(
comment = "#>",
eval = FALSE
)
requireNamespace("vip", quietly = TRUE)
```

```{r setup}
Expand Down
3 changes: 2 additions & 1 deletion vignettes/Missing_data_predictors.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ knitr::opts_chunk$set(
comment = "#>",
eval = FALSE
)
requireNamespace("vip", quietly = TRUE)
```

# Motivation
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions vignettes/interpretation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ knitr::opts_chunk$set(
out.height = "300px",
fig.width = 14
)
requireNamespace("vip", quietly = TRUE)
```

```{r setup}
Expand Down
Loading