HyperFast : Instant Classification for Tabular Data
[Update Nov 26, 2025] Interested in more accurate tabular data classification and support for regression? See our new model iLTM: Integrated Large Tabular Model (arXiv).
HyperFast is a hypernetwork designed for fast classification of tabular data, capable of scaling to large datasets. Utilizing a meta-trained hypernetwork, HyperFast generates a dataset-specific target network in a single forward pass, eliminating the need for time-consuming model training.
Installation
HyperFast can be installed from PyPI using
pip install hyperfast
This package contains example code to run HyperFast. Ensure that you are using Python 3.9 or later to run this project. When using HyperFast for the first time, the model weights will be downloaded automatically. The model weights are also available here.
Usage
Here's a quick example on how to use HyperFast's scikit-learn-like interface:
import torch
import numpy as np
from hyperfast import HyperFastClassifier
from sklearn.metrics import accuracy_score
# Load your dataset
X_train, y_train = np.load("data/hapmap1_X_train.npy"), np.load( "data/hapmap1_y_train.npy")
X_test, y_test = np.load("data/hapmap1_X_test.npy"), np.load("data/hapmap1_y_test.npy")
# Set the device
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
# Initialize HyperFast
model = HyperFastClassifier(device=device)
# Generate a target network and make predictions
model.fit(X_train, y_train)
predictions = model.predict(X_test)
accuracy = accuracy_score(y_test, predictions)
print(f"Accuracy: {accuracy * 100:.2f}%")
Warning:
- Set
cat_featuresas the list of indices of the categorical features in the dataset (if any), now in__init__. - The current default hyperparameters provide medium speed-accuracy performance.
- 🚀 For the fastest inference (but less accurate) set
n_ensemble=1andoptimization=None. - 📊 If you are dealing with an imbalanced dataset, consider setting
stratify_sampling=Truewithn_ensemble> 1. - 🌐 If you are dealing with a very high-dimensional dataset (e.g., >3000 features), consider setting
feature_bagging=Truewithn_ensemble> 1. - 👌 For slower but most accurate predictions, optimize the inference parameters of HyperFast for each dataset. In this case, we recommend the following search space:
from scipy.stats import loguniform, uniform
param_grid = {
'n_ensemble': [4, 8, 16, 32],
'batch_size': [1024, 2048],
'nn_bias': [True, False],
'nn_bias_scale': loguniform(0.01, 1.0), # Only when nn_bias=True.
'stratify_sampling': [True, False],
'optimization': ['ensemble_optimize', None], # Sampling weights: 9:1.
# Remaining parameters apply only when optimization is enabled.
'optimize_steps': [1, 4, 8, 16, 32, 64, 128, None],
'finetuning_lr': loguniform(1e-5, 3e-3),
'finetuning_dropout': uniform(0.0, 0.5),
'finetuning_weight_decay': loguniform(1e-6, 0.1),
'finetuning_parameter_scope': ['all', 'network', 'head'], # Sampling weights: 8:1:1.
'finetuning_batch_size': [128, 256, 1024],
'label_smoothing': [0.0, 0.05, 0.1],
}
Pass model.fit(X_train, y_train, eval_set=(X_val, y_val)) to select each
ensemble member's best validation checkpoint, including its initial weights.
Binary tasks use ROC-AUC and multiclass tasks use log loss. Validation rows are
excluded from preprocessing fitting, weight generation, gradient updates, and
nearest-neighbor references. Without an explicit validation set, fine-tuning
reserves a stratified 10% holdout before preprocessing.
Controlling fine-tuning
finetuning_parameter_scope="all" retains full predictor adaptation. Use
"network" to freeze the random projection and PCA, or "head" to also freeze
all hidden MLP layers. Enabled nearest-neighbor biases remain trainable.
These options do not update the pretrained hypernetwork or checkpoint.
License
This project is under the CC BY-NC 4.0 license. See LICENSE for details.
Cite us
If you use HyperFast in your research, please cite our paper:
@inproceedings{bonet2024hyperfast,
title={HyperFast: Instant Classification for Tabular Data},
author={Bonet, David and Montserrat, Daniel Mas and Gir{\'o}-i-Nieto, Xavier and Ioannidis, Alexander},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
year={2024}
}
Metadata
Release files for hyperfast 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hyperfast-1.1.1.tar.gz | 254.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hyperfast-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 281.0 kB
Release files / hyperfast-1.1.1.tar.gz
| Download URL | hyperfast-1.1.1.tar.gz |
|---|---|
| Size | 254.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccd9926d2c0b22f51e54d097d769d4010c5232282efc17308f901e71def4a469
|
|
BLAKE2b-256 checksum How to use checksums |
44f981bab928aedf656b976b97db53bcc4dc8b90744ab595c052ac4e65cc420e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.9
|
Release files / hyperfast-1.1.1-py3-none-any.whl
| Download URL | hyperfast-1.1.1-py3-none-any.whl |
|---|---|
| Size | 26.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c746fb00926c1b62a63481b6de9316362a5b91778b4f45bdf95e9490ce0fb536
|
|
BLAKE2b-256 checksum How to use checksums |
36d52ee99bce676a2de7ee25164d773aaf67d509210d170981433d095a4cb56a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.9
|
Security for hyperfast 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.