Package: tabnet 0.9.0.9000

Christophe Regouby

tabnet: Fit 'TabNet' Models for Classification and Regression

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.

Authors:Daniel Falbel [aut], RStudio [cph], Christophe Regouby [cre, ctb], Egill Fridgeirsson [ctb], Philipp Haarmeyer [ctb], Sven Verweij [ctb]

tabnet_0.9.0.9000.tar.gz
tabnet_0.9.0.9000.zip(r-4.7)tabnet_0.9.0.9000.zip(r-4.6)tabnet_0.9.0.9000.zip(r-4.5)
tabnet_0.9.0.9000.tgz(r-4.6-any)tabnet_0.9.0.9000.tgz(r-4.5-any)
tabnet_0.9.0.9000.tar.gz(r-4.7-any)tabnet_0.9.0.9000.tar.gz(r-4.6-any)
tabnet_0.9.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
tabnet/json (API)

# Install 'tabnet' in R:
install.packages('tabnet', repos = c('https://mlverse.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/mlverse/tabnet/issues

Pkgdown/docs site:https://mlverse.github.io

On CRAN:

Conda:

tabnet

9.93 score 116 stars 96 scripts 4.6k downloads 40 exports 117 dependencies

Last updated from:71c4ca1d73. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK244
source / vignettesOK265
linux-release-x86_64OK243
macos-release-arm64OK155
macos-oldrel-arm64OK202
windows-develOK169
windows-releaseOK157
windows-oldrelOK172
wasm-releaseOK162

Exports:%>%attention_widthaugmentbuild_ancestor_matrix_from_outcomescat_emb_dimcheck_compliant_nodecheckpoint_epochsdecision_widthdrop_lastencoder_activationentmaxentmax15feature_reusagelr_schedulermask_typemlp_activationmlp_hidden_multipliermomentumnn_aum_lossnn_mc_lossnnf_mc_lossnnf_multilabel_one_hotnode_to_dfnum_independentnum_independent_decodernum_sharednum_shared_decodernum_stepsoptimizerpenaltysparsemaxsparsemax15tabnettabnet_configtabnet_explaintabnet_fittabnet_nntabnet_pretrainverbosevirtual_batch_size

Dependencies:base64encbitbit64bslibcachemcallrclasscliclockcodetoolscorocpp11crayondata.tabledata.treedescdiagramdialsDiceDesigndigestdplyrevaluatefarverfastmapfontawesomefsfurrrfuturefuture.applyGauProgenericsggplot2globalsgluegowergtablehardhathighrhmshtmltoolsipredisobandjquerylibjsonliteKernSmoothknitrlabelinglatticelavalbfgslifecyclelistenvlubridatemagrittrMASSMatrixmemoisemimemixoptmodelenvnnetnumDerivotelparallellyparsnippillarpkgconfigprettyunitsprocessxprodlimprogressprogressrpspurrrR6rappdirsRColorBrewerRcppRcppArmadillorecipesrlangrmarkdownrpartrsampleS7safetensorssassscalessfdshapeslidersparsevctrssplitfngrSQUAREMstringistringrsurvivaltailortibbletidyrtidyselecttimechangetimeDatetinytextorchtunetzdbutf8vctrsviridisLitewarpwithrworkflowsxfunyamlyardstickzeallot

Hierarchical Classification
Data format | Data preparation | Node preparation rules for {tabnet} models | Avoid factor predictors | Avoid column name collision with reserved {data.tree} names | Avoid column named level_* to avoid collision with output data.tree names | Ensure the last hierarchy of the tree is the observation id | Ensure there is a root level in the hierarchy | Ensure there is no missing values in the hierarchical classes | Model building | Data set split | Model diagnostic | Model inference

Last update: 2026-06-12
Started: 2023-07-22

Self-supervised training and fine-tuning
Data preprocessing | Self-supervised training step | Continuing training with supervised task | Comparing against a model without pretraining

Last update: 2026-06-12
Started: 2023-07-22

Interpretation tools
Experiments | Datasets | Syn2 | Syn 4

Last update: 2025-08-25
Started: 2021-01-07

Using ROC AUM loss for imbalanced binary classification
Introduction | How imbalance is my problem ? | Solutions to improve imbalanced classification models | Using the AUC metric and pr_curve() plots | Case-weight | ROC_AUM loss | All together

Last update: 2025-08-25
Started: 2025-08-25

Fitting tabnet with tidymodels

Last update: 2025-04-25
Started: 2020-12-18

Training a Tabnet model from missing-values dataset
Motivation | Missing-data dataset creation | Ames missings understanding | While keeping some room for freedom | Ames with missing data | Model pretraining | Variable importance with raw ames dataset | Variable importance with ames_missing dataset | Model training | Conclusion

Last update: 2025-03-30
Started: 2022-02-11

Readme and manuals

Help Manual

Help pageTopics
Parameters for the tabnet modelattention_width decision_width feature_reusage mask_type momentum num_independent num_shared num_steps
Plot tabnet_explain mask importance heatmapautoplot.tabnet_explain
Plot tabnet_fit model loss along epochsautoplot.tabnet_fit autoplot.tabnet_pretrain
Build ancestor matrix aligned with observed outcome classesbuild_ancestor_matrix_from_outcomes
Non-tunable parameters for the tabnet modelcat_emb_dim checkpoint_epochs drop_last encoder_activation lr_scheduler mlp_activation mlp_hidden_multiplier num_independent_decoder num_shared_decoder optimizer penalty verbose virtual_batch_size
Check that Node object names are compliantcheck_compliant_node
Alpha-entmaxentmax entmax15
Apply hierarchy constraints via max-pooling over descendants (MCM)get_constr_output
Optimal threshold (tau) computation for 1.5-entmaxget_tau
AUM lossnn_aum_loss
Max-Constraint Margin Loss (module)nn_mc_loss
Prune top layer(s) of a tabnet networknn_prune_head.tabnet_fit nn_prune_head.tabnet_pretrain
Max-Constraint Margin Loss (functional)nnf_mc_loss
Convert class_id tensor to binary one-hot tensornnf_multilabel_one_hot
Turn a Node object into predictor and outcome.node_to_df
Predict using 'tabnet'augment.tabnet_fit predict.tabnet_fit
Sparsemaxsparsemax sparsemax15
Parsnip compatible tabnet modeltabnet
Configuration for TabNet modelstabnet_config
Interpretation metrics from a TabNet modeltabnet_explain tabnet_explain.default tabnet_explain.model_fit tabnet_explain.tabnet_fit tabnet_explain.tabnet_pretrain
Tabnet modeltabnet_fit tabnet_fit.data.frame tabnet_fit.default tabnet_fit.formula tabnet_fit.Node tabnet_fit.recipe
TabNet Model Architecturetabnet_nn
Tabnet modeltabnet_pretrain tabnet_pretrain.data.frame tabnet_pretrain.default tabnet_pretrain.formula tabnet_pretrain.Node tabnet_pretrain.recipe