Registry / ai-ml / pytorch-tabnet

pytorch-tabnet

JSON →
library4.1.0pypypiunverified

PyTorch implementation of TabNet (Google's attention-based tabular network). Current version 4.1.0, with semi-annual releases. Supports classification, regression, and unsupervised pre-training.

pip install pytorch-tabnet
INSTALL
IMPORT
SIG · PYTORCH-TABNET
P
pytorch-tabnet
ai-mlpythonv4.1.0
Install
74.8s avg
Import
Disk
5018MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 88.2s
py 3.11
✕ build_error
✓ 77.7s
py 3.12
✕ build_error
✓ 68.8s
py 3.13
✕ build_error
✓ 64.7s
py 3.9
✕ build_error
✕ timeout
5018MB installed
● package 5018MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TabNetClassifier
from pytorch_tabnet import TabNetClassifier
from pytorch_tabnet.tab_model import TabNetClassifier

Minimal example of fitting a TabNetClassifier on random data.

from pytorch_tabnet.tab_model import TabNetClassifier import numpy as np X_train = np.random.rand(100, 10) y_train = np.random.randint(0, 2, 100) clf = TabNetClassifier(device_name='cpu') clf.fit(X_train, y_train, max_epochs=10) print(clf.predict(X_train))
Debug
Known issues
breakingIn v4.0, the unsupervised pretraining loss was changed to match the original paper. Models trained with pretraining in v3.x cannot be directly resumed or fine-tuned in v4.x without retraining.
fix
Retrain any models that used unsupervised pretraining after upgrading to v4.x.
affects: v4.0+
breakingThe default metric for regression changed from 'mse' to 'rmse' in v3.0.0. If you relied on default metric behavior, your training/evaluation results may differ.
fix
Explicitly set the `eval_metric` parameter to 'mse' to retain old behavior.
affects: v3.0.0+
gotchaWhen using categorical features, `cat_idxs` and `cat_dims` must be consistent. An error is raised only in v4.0+ if they are incoherent.
fix
Ensure `len(cat_idxs) == len(cat_dims)` and that each index corresponds to a valid column.
affects: >=4.0
gotchaSaving and loading models: use `save_model` and `load_model` methods. Directly pickling the model object is not supported and may break.
fix
Use clf.save_model('model.pt') and clf.load_model('model.pt').
affects: all
Upgrade
Version history
4.1.0latest on PyPI · released Jul 23, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pytorch-tabnet — pip install pytorch-tabnet · libregistry