PyTabKit
raw JSON → 1.7.3 verified Fri May 01 auth: no python
PyTabKit provides ML models and a benchmark for tabular data classification and regression. Current version is 1.7.3, supporting Python >=3.9, with PyTorch-based models like RealMLP, xRFM, TabM, and TabICL wrappers, plus scikit-learn-style interfaces, HPO, and ensembling. Release cadence is irregular, with several updates in 2024-2025.
pip install pytabkit Common errors
error ModuleNotFoundError: No module named 'pytabkit' ↓
cause Package not installed or installed in wrong environment.
fix
Run 'pip install pytabkit' for base version, or 'pip install pytabkit[extra]' for full functionality.
error ImportError: cannot import name 'RealMLP_Ensemble_Classifier' from 'pytabkit.models.sklearn.realmlp' ↓
cause RealMLP_Ensemble_* classes removed in v1.5.0.
fix
Use 'RealMLP_Tabular_Classifier' with 'use_caruana_ensembling=True'.
error ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). ↓
cause CuML's RandomForestClassifier expects differently formatted data? Actually this may come from pandas usage; but often occurs when passing DataFrame where array expected.
fix
Ensure you pass NumPy arrays or DataFrames as appropriate. Use .values if needed.
Warnings
breaking In v1.5.0, RealMLP_Ensemble_Classifier and RealMLP_Ensemble_Regressor were removed. Use RealMLP_Tabular_Classifier with use_caruana_ensembling=True instead. ↓
fix Replace 'from pytabkit.models.sklearn.realmlp import RealMLP_Ensemble_Classifier' with 'from pytabkit.models.sklearn.realmlp import RealMLP_Tabular_Classifier' and add 'use_caruana_ensembling=True' to the constructor.
breaking In v1.6.1, default classification ensembling changed from averaging logits to averaging probabilities. This may change results. ↓
fix To revert to logit averaging, set 'ens_av_before_softmax=True' in the model constructor.
gotcha When using extra models (GBDT, CatBoost, TabM), ensure you install pytabkit with the 'extra' option: pip install pytabkit[extra]. The base install only includes RealMLP. ↓
fix Install the extra dependencies: 'pip install pytabkit[extra]'.
Install
pip install pytabkit[extra] Imports
- RealMLP_Tabular_Classifier wrong
from pytabkit import RealMLP_Tabular_Classifiercorrectfrom pytabkit.models.sklearn.realmlp import RealMLP_Tabular_Classifier - RealMLP_Tabular_Regressor wrong
from pytabkit.models.realmlp import RealMLP_Tabular_Regressorcorrectfrom pytabkit.models.sklearn.realmlp import RealMLP_Tabular_Regressor - TabM_Classifier wrong
from pytabkit import TabM_Classifiercorrectfrom pytabkit.models.sklearn.tabm import TabM_Classifier
Quickstart
from pytabkit.models.sklearn.realmlp import RealMLP_Tabular_Classifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
X, y = make_classification(n_samples=100, n_features=20, random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
model = RealMLP_Tabular_Classifier(
time_limit_s=30, # limit training time
n_refit=1,
device='cpu'
)
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
print(f'Accuracy: {sum(y_pred == y_test) / len(y_test):.3f}')