Run this model with HF Jobs
Run stable-ai/LimiX-1_16M on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/stable-ai/LimiX-1_16M. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/stable-ai/LimiX-1_16M on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use stable-ai/LimiX-1_16M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stable-ai/LimiX-1_16M with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("stable-ai/LimiX-1_16M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload 19 files
Browse filesFiles changed (20)
- .gitattributes+15
- README.md+329-5
- README_cn.mdAdded+307
- doc/BCCO-CLS.pngAdded
- doc/BCCO-REG.pngAdded
- doc/CTR23-REG.pngAdded
- doc/Classifier.pngAdded
- doc/LimiX-Logo.pngAdded
- doc/LimiX_Summary.pngAdded
- doc/MissingValueImputation.pngAdded
- doc/Regression.pngAdded
- doc/TabArena-CLS.pngAdded
- doc/TabArena-REG.pngAdded
- doc/TabArena_REG.pngAdded
- doc/TabArena_lite_CLS.pngAdded
- doc/TabZilla-CLS.pngAdded
- doc/Usage_tips.mdAdded+9
- doc/Usage_tips_cn.mdAdded+10
- doc/classification_tabarena_lite.pngAdded
- doc/regression_tabarena_lite.pngAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines33343536373839404142434445464748495032 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textdoc/BCCO-CLS.png filter=lfs diff=lfs merge=lfs -textdoc/BCCO-REG.png filter=lfs diff=lfs merge=lfs -textdoc/classification_tabarena_lite.png filter=lfs diff=lfs merge=lfs -textdoc/Classifier.png filter=lfs diff=lfs merge=lfs -textdoc/CTR23-REG.png filter=lfs diff=lfs merge=lfs -textdoc/LimiX_Summary.png filter=lfs diff=lfs merge=lfs -textdoc/LimiX-Logo.png filter=lfs diff=lfs merge=lfs -textdoc/MissingValueImputation.png filter=lfs diff=lfs merge=lfs -textdoc/regression_tabarena_lite.png filter=lfs diff=lfs merge=lfs -textdoc/Regression.png filter=lfs diff=lfs merge=lfs -textdoc/TabArena_lite_CLS.png filter=lfs diff=lfs merge=lfs -textdoc/TabArena_REG.png filter=lfs diff=lfs merge=lfs -textdoc/TabArena-CLS.png filter=lfs diff=lfs merge=lfs -textdoc/TabArena-REG.png filter=lfs diff=lfs merge=lfs -textdoc/TabZilla-CLS.png filter=lfs diff=lfs merge=lfs -text
12345---license: otherlicense_name: licenselicense_link: LICENSE---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329<div align="center"><img src="./doc/LimiX-Logo.png" alt="LimiX summary" width="89%"></div># LimiX: Large Structured-Data Foundation Model(LDM)LimiX is the first structured-data foundation model built for general intelligence. Focused on joint distribution modeling of variables and missing values, one single model covers the full suite of tabular tasks: classification, regression, missing value imputation and tabular generation, with no need for task-specific network design. It surpasses XGBoost, classic tabular deep learning models and existing tabular foundation models on benchmarks of 10 mainstream structured datasets. All model resources are open-sourced under the Apache 2.0 License.[](https://arxiv.org/abs/2509.03505)[](https://www.limix.ai/)[](https://modelscope.cn/organization/stable-ai)[](https://huggingface.co/stable-ai)# :boom: News## 📢 News- **[2026.06.04] LimiX-2M has been accepted to ICML 2026!**It is an extension of the original LimiX structured-data foundation model.[](https://arxiv.org/abs/2606.04485)- **[2025.11.10] LimiX-2M is officially released!**Compared to LimiX-16M, this smaller variant offers significantly lower GPU memory usage and faster inference speed. The retrieval mechanism has also been enhanced, further improving model performance while reducing both inference time and memory consumption.- **[2025.09.03] Initial LimiX paper released on arXiv**Original paper: [arXiv:2509.03505](https://arxiv.org/abs/2509.03505), the first large structured-data foundation model for generalist intelligence, open-source under Apache 2.0 license.- **[2025.08.29] LimiX V1.0 Released.**The first official stable version of LimiX structured-data foundation model is open sourced.# ⚡ Latest Results Compared with SOTA Models<div align="center"><img src="./doc/BCCO-CLS.png" width="30%"><img src="./doc/TabArena-CLS.png" width="30%"><img src="./doc/TabZilla-CLS.png" width="30%"></div><div align="center"><img src="./doc/BCCO-REG.png" width="30%"><img src="./doc/TabArena-REG.png" width="30%"><img src="./doc/CTR23-REG.png" width="30%"></div># ➤ Overview<div align="center"><img src="./doc/LimiX_Summary.png" alt="LimiX summary" width="89%"></div>We introduce LimiX, the first installment of our LDM series. LimiX aims to push generality further: a single model that handles classification, regression, missing-value imputation, feature selection, sample selection, and causal inference under one training and inference recipe, advancing the shift from bespoke pipelines to unified, foundation-style tabular learning.LimiX adopts a transformer architecture optimized for structured data modeling and task generalization. The model first embeds features X and targets Y from the prior knowledge base into token representations. Within the core modules, attention mechanisms are applied across both sample and feature dimensions to identify salient patterns in key samples and features. The resulting high-dimensional representations are then passed to regression and classification heads, enabling the model to support diverse predictive tasks.For details, please refer to the technical report at the link: [LimiX:Unleashing Structured-Data Modeling Capability for Generalist Intelligence](https://arxiv.org/abs/2509.03505) or [LimiX_Technical_Report.pdf](https://github.com/limix-ldm/LimiX/blob/main/LimiX_Technical_Report.pdf).# ➤ Superior PerformanceThe LimiX model achieved SOTA performance across multiple tasks.## ➩ Classification<div align="center"><img src="doc/classification_tabarena_lite.png" width="60%"></div><div align="center"><img src="doc/Classifier.png" width="45%" style="margin-right:2%;"><img src="doc/TabArena_lite_CLS.png" width="42.5%"></div>## ➩ Regression<div align="center"><img src="doc/regression_tabarena_lite.png" width="60%"></div><div align="center"><img src="doc/Regression.png" width="45%" style="margin-right:2%;"><img src="doc/TabArena_REG.png" width="40.3%"></div>## ➩ Missing Values Imputation<div align="center"><img src="doc/MissingValueImputation.png" alt="Missing value imputation" width="60%"></div># ➤ Tutorials## ➩ Installation### Option 1 (recommended): Use the DockerfileDownload [Dockerfile](https://github.com/limix-ldm/LimiX/blob/main/Dockerfile)```bashdocker build --network=host -t limix/infe:v1 --build-arg FROM_IMAGES=nvidia/cuda:12.2.0-base-ubuntu22.04 -f Dockerfile .```### Option 2: Build manuallyDownload the prebuilt flash_attn files```bashwget -O flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whl https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.0.post2/flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whl```Install Python dependencies```bashpip install python==3.12.7 torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1pip install flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whlpip install scikit-learn einops huggingface-hub matplotlib networkx numpy pandas scipy tqdm typing_extensions xgboost kditransform hyperopt```### Download source code```bashgit clone https://github.com/limix-ldm/LimiX.gitcd LimiX```# ➤ InferenceLimiX supports tasks such as classification, regression, and missing value imputation## ➩ Model download| Model size | Download link | Tasks supported || --- | --- | --- || LimiX-16M | [LimiX-16M.ckpt](https://huggingface.co/stableai-org/LimiX-16M/tree/main) | ✅ classification ✅regression ✅missing value imputation || LimiX-2M | [LimiX-2M.ckpt](https://huggingface.co/stableai-org/LimiX-2M/tree/main) | ✅ classification ✅regression |## ➩ Interface description### Model Creation```pythonclass LimiXPredictor:def __init__(self,device:torch.device,model_path:str,mix_precision:bool=True,inference_config: list|str,categorical_features_indices:List[int]|None=None,outlier_remove_std: float=12,softmax_temperature:float=0.9,mask_prediction:bool=False,inference_with_DDP: bool = False,seed:int=0)```| Parameter | Data Type | Description ||--------|----------|----------|| device | torch.device | The hardware that loads the model || model_path | str | The path to the model that needs to be loaded || mix_precision | bool | Whether to enable the mixed precision inference || inference_config | list/str | Configuration file used for inference || categorical_features_indices | list | The indices of categorical columns in the tabular data || outlier_remove_std | float | The threshold is employed to remove outliers, defined as values that are multiples of the standard deviation || softmax_temperature | float | The temperature used to control the behavior of softmax operator || mask_prediction | bool | Whether to enable missing value imputation || inference_with_DDP | bool | Whether to enable DDP during inference || seed | int | The seed to control random states |### Predict```pythondef predict(self, x_train:np.ndarray, y_train:np.ndarray, x_test:np.ndarray, task_type:Literal['Classification', 'Regression']='Classification') -> np.ndarray:```| Parameter | Data Type | Description || ------- | ---------- | ----------------- || x_train | np.ndarray | The input features of the training set || y_train | np.ndarray | The target variable of the training set || x_test | np.ndarray | The input features of the test set || task_type | str | The task type which can be either "Classification" or "Regression" |## Inference Configuration File Description| Configuration File Name | Description | Difference || ------- | ---------- | ----- || cls_default_retrieval.json | Default **classification task** inference configuration file **with retrieval** | Better classification performance || cls_default_noretrieval.json | Default **classification task** inference configuration file **without retrieval** | Faster speed, lower memory requirements || reg_default_retrieval.json | Default **regression task** inference configuration file **with retrieval** | Better regression performance || reg_default_noretrieval.json | Default **regression task** inference configuration file **without retrieval** | Faster speed, lower memory requirements || reg_default_noretrieval_MVI.json | Default inference configuration file for **missing value imputation task** | |## ➩ Ensemble Inference Based on Sample RetrievalFor a detailed technical introduction to Ensemble Inference Based on Sample Retrieval, please refer to the [technical report](https://github.com/limix-ldm/LimiX/blob/main/LimiX_Technical_Report.pdf).Considering inference speed and memory requirements, ensemble inference based on sample retrieval currently only supports hardware with specifications higher than the NVIDIA RTX 4090 GPU.### Classification Task```python inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```### Regression Task```python inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```### Customizing Data Preprocessing for Inference Tasks#### First, Generate the Inference Configuration File```pythongenerate_inference_config()```### Classification Task#### Single GPU or CPU```python inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```#### Multi-GPU Distributed Inference```torchrun --nproc_per_node=8 inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data --inference_with_DDP```### Regression Task#### Single GPU or CPU```python inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```#### Multi-GPU Distributed Inference```torchrun --nproc_per_node=8 inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data --inference_with_DDP```### Retrieval Optimization ProjectThis project implements an optimized retrieval system. To achieve the best performance, we utilize Optuna for hyperparameter tuning of retrieval parameters.#### InstallationEnsure you have the required dependencies installed:```pip install optuna```#### UsageFor standard inference using pre-optimized parameters, refer to the code below:```searchInference = RetrievalSearchHyperparameters(dict(device_id=0,model_path=model_path), X_train, y_train, X_test, y_test,)config, result = searchInference.search(n_trials=10, metric="AUC",inference_config='config/cls_default_retrieval.json',task_type="cls")```This will launch an Optuna study to find the best combination of retrieval parameters for your specific dataset and use case.## ➩ Classification```pythonfrom sklearn.datasets import load_breast_cancerfrom sklearn.metrics import accuracy_score, roc_auc_scorefrom sklearn.model_selection import train_test_splitfrom huggingface_hub import hf_hub_downloadimport numpy as npimport os, sysos.environ["RANK"] = "0"os.environ["WORLD_SIZE"] = "1"os.environ["MASTER_ADDR"] = "127.0.0.1"os.environ["MASTER_PORT"] = "29500"ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))if ROOT_DIR not in sys.path:sys.path.insert(0, ROOT_DIR)from inference.predictor import LimiXPredictorX, y = load_breast_cancer(return_X_y=True)X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)model_file = hf_hub_download(repo_id="stableai-org/LimiX-16M", filename="LimiX-16M.ckpt", local_dir="./cache")clf = LimiXPredictor(device=torch.device('cuda'), model_path=model_file, inference_config='config/cls_default_retrieval.json')prediction = clf.predict(X_train, y_train, X_test, task_type="Classification")print("roc_auc_score:", roc_auc_score(y_test, prediction[:, 1]))print("accuracy_score:", accuracy_score(y_test, np.argmax(prediction, axis=1)))```For additional examples, refer to [inference_classifier.py](./inference_classifier.py)## ➩ Regression```pythonfrom functools import partialfrom sklearn.datasets import fetch_california_housingfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import r2_scorefrom huggingface_hub import hf_hub_downloadtry:from sklearn.metrics import root_mean_squared_error as mean_squared_errorexcept:from sklearn.metrics import mean_squared_errormean_squared_error = partial(mean_squared_error, squared=False)import os, sysos.environ["RANK"] = "0"os.environ["WORLD_SIZE"] = "1"os.environ["MASTER_ADDR"] = "127.0.0.1"os.environ["MASTER_PORT"] = "29500"ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))if ROOT_DIR not in sys.path:sys.path.insert(0, ROOT_DIR)from inference.predictor import LimiXPredictorhouse_data = fetch_california_housing()X, y = house_data.data, house_data.targetX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)y_mean = y_train.mean()y_std = y_train.std()y_train_normalized = (y_train - y_mean) / y_stdy_test_normalized = (y_test - y_mean) / y_stdmodel_path = hf_hub_download(repo_id="stableai-org/LimiX-16M", filename="LimiX-16M.ckpt", local_dir="./cache")model = LimiXPredictor(device=torch.device('cuda'), model_path=model_path, inference_config='config/reg_default_retrieval.json')y_pred = model.predict(X_train, y_train_normalized, X_test, task_type="Regression")# Compute RMSE and R²y_pred = y_pred.to('cpu').numpy()rmse = mean_squared_error(y_test_normalized, y_pred)r2 = r2_score(y_test_normalized, y_pred)print(f'RMSE: {rmse}')print(f'R2: {r2}')```For additional examples, refer to [inference_regression.py](./inference_regression.py)## ➩ Missing value imputationFor the demo file, see [examples/demo_missing_value_imputation.py](examples/inference_regression.py)# ➤ Link- LimiX:Unleashing Structured-Data Modeling Capability for Generalist Intelligence: [LimiX:Unleashing Structured-Data Modeling Capability for Generalist Intelligence](https://arxiv.org/abs/2509.03505)- LimiX Technical Report: [LimiX_Technical_Report.pdf](https://github.com/limix-ldm/LimiX/blob/main/LimiX_Technical_Report.pdf)- Detailed instructions for using Limix: [Visit the official Limix documentation](https://www.limix.ai/doc/)- Balance Comprehensive Challenging Omni-domain Classification Benchmark: [bcco_cls](https://huggingface.co/datasets/stableai-org/bcco_cls)- Balance Comprehensive Challenging Omni-domain Regression Benchmark: [bcco_reg](https://huggingface.co/datasets/stableai-org/bcco_reg)# ➤ LicenseThe code in this repository is open-sourced under the [Apache-2.0](LICENSE.txt) license, while the usage of the LimiX model weights is subject to the Model License. The LimiX weights are fully available for academic research and may be used commercially upon obtaining proper authorization.# ➤ Citation```@article{zhang2025limix,title={Limix: Unleashing structured-data modeling capability for generalist intelligence},author={Zhang, Xingxuan and Ren, Gang and Yu, Han and Yuan, Hao and Wang, Hui and Li, Jiansheng and Wu, Jiayun and Mo, Lang and Mao, Li and Hao, Mingchao and others},journal={arXiv preprint arXiv:2509.03505},year={2025}}```
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307<div align="center"> <img src="./doc/LimiX-Logo.png" alt="LimiX summary" width="89%"></div>
# LimiX:面向结构化数据的大基础模型(LDM)LimiX是首个面向通用智能研发的结构化数据大模型。模型以变量与缺失值的联合分布建模为核心,单模型即可一站式完成全品类表格任务:分类、回归、缺失值填充与表格数据生成,无需针对不同任务定制专属网络结构。在10项主流结构化数据集基准测试上,模型效果全面优于XGBoost、传统表格深度学习模型以及现有的表格基座模型。项目全部模型资源依据Apache 2.0开源协议开放。
[](https://arxiv.org/abs/2509.03505)[](https://www.limix.ai/)[](https://modelscope.cn/organization/stable-ai)[](https://huggingface.co/stable-ai)
## 📢 更新动态- **[2026.06.04] LimiX 后续延伸研究成果被 ICML 会议录用!** 论文:[arXiv:2606.04485](https://arxiv.org/pdf/2606.04485),该工作是初代LimiX(arXiv:2509.03505)结构化数据基础模型的拓展研究。[](https://arxiv.org/pdf/2606.04485)- **[2025.11.10] LimiX-2M 轻量化模型正式发布!** 相较LimiX-16M版本,该轻量模型大幅降低GPU显存占用、提升推理速度;同时优化检索机制,在缩减推理耗时与内存开销的前提下进一步提升模型效果。- **[2025.09.03] LimiX 论文于arXiv上线发布** 原论文:[arXiv:2509.03505](https://arxiv.org/abs/2509.03505),LimiX是面向通用智能的首款结构化数据大模型,项目基于Apache 2.0协议开源。- **[2025.08.29] LimiX V1.0 正式发布** LimiX结构化数据基础模型首个稳定官方版本开源上线。 # ⚡ 最新评测<div align="center"> <img src="./doc/BCCO-CLS.png" width="30%"> <img src="./doc/TabArena-CLS.png" width="30%"> <img src="./doc/TabZilla-CLS.png" width="30%"> </div><div align="center"> <img src="./doc/BCCO-REG.png" width="30%"> <img src="./doc/TabArena-REG.png" width="30%"> <img src="./doc/CTR23-REG.png" width="30%"></div>
# ➤ 简介<div align="center"> <img src="./doc/LimiX_Summary.png" alt="LimiX summary" width="89%"></div>我们推出 LDM 系列的首个模型—极数。极数的目标在于进一步提升通用性:在统一的训练与推理框架下,同时处理分类、回归、缺失值插补、特征选择、样本选择和因果推理等任务,从而推动表格学习从定制化流程迈向基础模型范式的转变。
极数基于专为结构化数据建模和任务泛化优化的 Transformer 架构。 模型首先将先验知识库中的特征 𝑋 与目标 𝑌 映射为 token 表示。在核心模块中,注意力机制同时作用于样本维度和特征维度,以捕捉关键样本与特征的显著模式。随后,高维表示被送入回归与分类模块,从而支持多种任务的输出。
技术报告详见:[LimiX:Unleashing Structured-Data Modeling Capability for Generalist Intelligence](https://arxiv.org/abs/2509.03505) / [LimiX_Technical_Report.pdf](https://github.com/limix-ldm/LimiX/blob/main/LimiX_Technical_Report.pdf)
# ➤ 对比测试LimiX模型在多个任务的测试中达到了当前最优性能.## ➩ 分类<div align="center"> <img src="doc/classification_tabarena_lite.png" width="60%"></div>
<div align="center"> <img src="doc/Classifier.png" width="45%" style="margin-right:2%;"> <img src="doc/TabArena_lite_CLS.png" width="42.5%"></div>
## ➩ 回归<div align="center"> <img src="doc/regression_tabarena_lite.png" width="60%"></div><div align="center"> <img src="doc/Regression.png" width="45%" style="margin-right:2%;"> <img src="doc/TabArena_REG.png" width="40.3%"></div>
## ➩ 缺失值插补<div align="center"> <img src="doc/MissingValueImputation.png" alt="Missing value imputation" width="80%"></div>
# ➤ 教程## ➩ 安装### 方式1,使用Dockerfile (建议)下载[Dockerfile](https://github.com/limix-ldm/LimiX/blob/main/Dockerfile)```bashdocker build --network=host -t limix/infe:v1 --build-arg FROM_IMAGES=nvidia/cuda:12.2.0-base-ubuntu22.04 -f Dockerfile .```### 方式2,自行构建环境下载 flash_attn 预编译文件```bashwget -O flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whl https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.0.post2/flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whl```环境安装```bashpip install python==3.12.7 torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1pip install flash_attn-2.8.0.post2+cu12torch2.7cxx11abiTRUE-cp312-cp312-linux_x86_64.whlpip install scikit-learn einops huggingface-hub matplotlib networkx numpy pandas scipy tqdm typing_extensions xgboost kditransform hyperopt```
# ➤ 推理任务LimiX支持分类、回归、缺失值插补等任务。## ➩ 模型下载| 模型尺寸 | 下载链接 | 支持的任务 || --- | --- | --- || LimiX-16M | [LimiX-16M.ckpt](https://huggingface.co/stableai-org/LimiX-16M/tree/main) | ✅ 分类 ✅回归 ✅缺失值插补 || LimiX-2M | [LimiX-2M.ckpt](https://huggingface.co/stableai-org/LimiX-2M/tree/main) | ✅ 分类 ✅回归 |
## ➩ 接口说明### 创建模型```pythonclass LimiXPredictor: def __init__(self, device:torch.device, model_path:str, mix_precision:bool=True, inference_config: list|str, categorical_features_indices:List[int]|None=None, outlier_remove_std: float=12, softmax_temperature:float=0.9, mask_prediction:bool=False, inference_with_DDP: bool = False, seed:int=0)```| 参数名 | 数据类型 | 参数说明 ||--------|----------|----------|| device | torch.device | 运行模型的硬件 || model_path | str | 需要加载的模型的路径 || mix_precision | bool | 是否启动混合进度计算 || inference_config | list/str | 推理使用的配置文件 || categorical_features_indices | list | 数据表中,分类列的序号 || outlier_remove_std | float | 移除异常值时采用的标准差倍数阈值 || softmax_temperature | float | Softmax 温度 或 温度系数 || mask_prediction | bool | 是否启用缺失值插补功能 || inference_with_DDP | bool | 在推理时是否开启DDP || seed | int | 随机种子 |### 数据推理```pythondef predict(self, x_train:np.ndarray, y_train:np.ndarray, x_test:np.ndarray, task_type: Literal['Classification', 'Regression']='Classification') -> np.ndarray:```| 参数名 | 数据类型 | 参数说明 || ------- | ---------- | ----------------- || x_train | np.ndarray | 训练集的 feature || y_train | np.ndarray | 训练集的预测目标 || x_test | np.ndarray | 测试集的 feature || task_type | str | 任务类型,取值范围为:Classification, Regression |
## ➩ 推理配置文件说明| 配置文件名称 | 配置文件说明 | 差异 || ------- | ---------- | ----- || cls_default_retrieval.json | 默认的**含有retrieval**功能的**分类任务**推理配置文件 | 分类性能更好 || cls_default_noretrieval.json | 默认的**不含有retrieval**功能的**分类任务**推理配置文件 | 速度更快、显存需求更低 || reg_default_retrieval.json | 默认的**含有retrieval**功能的**回归任务**推理配置文件 | 回归性能更好 || reg_default_noretrieval.json | 默认的**不含有retrieval**功能的**回归任务**推理配置文件 | 速度更快、显存需求更低 || reg_default_noretrieval_MVI.json | 默认的**缺失值插补**任务推理配置文件 | |
## ➩ 基于样本检索的ensemble推理基于样本检索的ensemble推理的详细技术描述详见[LimiX技术报告](https://github.com/limix-ldm/LimiX/blob/main/LimiX_Technical_Report.pdf)考虑到推理速度、显存占用,基于样本检索的ensemble推理目前只支持基于版本高于NVIDIA-RTX 4090显卡的硬件条件。### 分类任务```python inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```
### 回归任务```python inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```
### 个性化设置推理任务的数据预处理方式#### 首先生成inference_config文件```pythongenerate_infenerce_config()```
### 分类任务#### 单卡或者CPU```python inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```#### 多卡分布式推理```torchrun --nproc_per_node=8 inference_classifier.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data --inference_with_DDP```
### 回归任务#### 单卡或者CPU```python inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data```#### 多卡分布式推理```torchrun --nproc_per_node=8 inference_regression.py --save_name your_save_name --inference_config_path path_to_retrieval_config --data_dir path_to_data --inference_with_DDP```
### 样本检索的超参检索本项目提供了一个样本检测的超参搜索套件。为了获得最佳性能,我们使用 Optuna 对检索参数进行超参数优化#### 安装```pip install optuna```#### 使用方法若要使用超参数优化进行标准推理,请参考如下代码,这段代码将启动一个 Optuna 搜索,用于为��定数据集和应用场景寻找最佳的检索参数组合:```searchInference = RetrievalSearchHyperparameters( dict(device_id=0, model_path=model_path), X_train, y_train, X_test, y_test,)config, result = searchInference.search( n_trials=10, metric="AUC", inference_config='config/cls_default_retrieval.json', task_type="cls")```
## ➩ 分类
```pythonfrom sklearn.datasets import load_breast_cancerfrom sklearn.metrics import accuracy_score, roc_auc_scorefrom sklearn.model_selection import train_test_splitfrom huggingface_hub import hf_hub_downloadimport numpy as npimport os, sys
os.environ["RANK"] = "0"os.environ["WORLD_SIZE"] = "1"os.environ["MASTER_ADDR"] = "127.0.0.1"os.environ["MASTER_PORT"] = "29500"
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))if ROOT_DIR not in sys.path: sys.path.insert(0, ROOT_DIR)from inference.predictor import LimiXPredictor
X, y = load_breast_cancer(return_X_y=True)X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
model_file = hf_hub_download(repo_id="stableai-org/LimiX-16M", filename="LimiX-16M.ckpt", local_dir="./cache")
clf = LimiXPredictor(device=torch.device('cuda'), model_path=model_file, inference_config='config/cls_default_retrieval.json')prediction = clf.predict(X_train, y_train, X_test, task_type="Classification")
print("roc_auc_score:", roc_auc_score(y_test, prediction[:, 1]))print("accuracy_score:", accuracy_score(y_test, np.argmax(prediction, axis=1)))```更加详细的样例详见: [inference_classifier.py](./inference_classifier.py)
## ➩ 回归```pythonfrom functools import partial
from sklearn.datasets import fetch_california_housingfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import r2_scorefrom huggingface_hub import hf_hub_downloadtry: from sklearn.metrics import root_mean_squared_error as mean_squared_errorexcept: from sklearn.metrics import mean_squared_error mean_squared_error = partial(mean_squared_error, squared=False)import os, sys
os.environ["RANK"] = "0"os.environ["WORLD_SIZE"] = "1"os.environ["MASTER_ADDR"] = "127.0.0.1"os.environ["MASTER_PORT"] = "29500"
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))if ROOT_DIR not in sys.path: sys.path.insert(0, ROOT_DIR)from inference.predictor import LimiXPredictor
house_data = fetch_california_housing()X, y = house_data.data, house_data.targetX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
y_mean = y_train.mean()y_std = y_train.std()y_train_normalized = (y_train - y_mean) / y_stdy_test_normalized = (y_test - y_mean) / y_std
model_path = hf_hub_download(repo_id="stableai-org/LimiX-16M", filename="LimiX-16M.ckpt", local_dir="./cache")
model = LimiXPredictor(device=torch.device('cuda'), model_path=model_path, inference_config='config/reg_default_retrieval.json')y_pred = model.predict(X_train, y_train_normalized, X_test, task_type="Regression")
# Compute RMSE and R²y_pred = y_pred.to('cpu').numpy()rmse = mean_squared_error(y_test_normalized, y_pred)r2 = r2_score(y_test_normalized, y_pred)
print(f'RMSE: {rmse}')print(f'R2: {r2}')```更加详细的样例详见: [inference_regression.py](./inference_regression.py)
## ➩ 缺失值插补样例详见: [examples/demo_missing_value_imputation.py](examples/inference_regression.py)
# ➤ 链接 - LimiX(极数):结构化数据通用大模型:[LimiX:Unleashing Structured-Data Modeling Capability for Generalist Intelligence](https://arxiv.org/abs/2509.03505) - LimiX技术报告:[LimiX_Technical_Report.pdf](https://github.com/limix-ldm/LimiX/blob/main/LimiX_Technical_Report.pdf) - 平衡、全面、有挑战、跨领域的分类数据集:[bcco_cls](https://huggingface.co/datasets/stableai-org/bcco_cls) - 平衡、全面、有挑战、跨领域的回归数据集:[bcco_reg](https://huggingface.co/datasets/stableai-org/bcco_reg)
# ➤ 协议本仓库的代码依照 [Apache-2.0](LICENSE.txt) 协议开源,LimiX 模型的权重的使用则需要遵循 Model License。LimiX 权重对学术研究完全开放,在进行授权后允许商业使用。
# ➤ 引用```@article{zhang2025limix, title={Limix: Unleashing structured-data modeling capability for generalist intelligence}, author={Zhang, Xingxuan and Ren, Gang and Yu, Han and Yuan, Hao and Wang, Hui and Li, Jiansheng and Wu, Jiayun and Mo, Lang and Mao, Li and Hao, Mingchao and others}, journal={arXiv preprint arXiv:2509.03505}, year={2025}}```123456789## Usage tips### When to use LimiXLimiX is designed for tabular datasets comprising fewer than 50,000 samples and fewer than 10,000 features. Larger datasets increase the model’s hardware requirements, while the performance gains compared to models such as XGBoost may be limited.### Intended use cases for LimiXLimiX can be applied to both classification、 regression and missing value imputation tasks involving tabular data. Compared with methods such as XGBoost and CatBoost, it demonstrates faster training and inference speeds, while achieving superior model performance.### Limitations in the use of LimiXWhen the dataset comprises a large number of samples, LimiX may require more hardware resources and exhibit lower performance compared to supervised models such as XGBoost.### Computational and time requirementsLeveraging its model architecture, LimiX attains higher processing speeds than conventional machine learning methods and does not necessitate the extensive GPU resources typically required by large language models.12345678910## 使用提示### 什么时候使用 LimiXLimiX 主要用于解决样本量小于5万并且特征数不超过1万的表格数据。当样本量更大时模型对硬件的需求会增加并且模型性能相对 XGBoost 等模型可能没有明显的差异。### LimiX 的预期用途LimiX 可以用来解决表格类数据的分类、回归问题、缺失值补插问题,相较于 XGBoost、CatBoost 等方法具有较快的训练及推理速度同时表现出较高的模型性能。### LimiX 的使用限制当样本量较大时,LimiX 对硬件资源的需求可能会超过传统的机器学习模型, 并且性能可能不及 XGBoost 等监督学习模型。### 计算和时间需求得益于 LimiX 的模型架构,LimiX 相较于传统的机器学习方法具有较高的处理速度,并且它不需要像 LLM 一样占用非常大的GPU资源。
.gitattributes+15
README.md+329-5
README_cn.mdAdded+307
doc/BCCO-CLS.pngAdded

Large File Pointer Details
- SHA256: a44ce794232a0a769596723bdfe30346edc577389ee92b2de2f5a5acacd30df0
- Pointer size: 131 Bytes
- Size of remote file: 365 kB
doc/BCCO-REG.pngAdded

Large File Pointer Details
- SHA256: 9a271e4bd34fb4d8848bea46b853cf720fdb71e57f6832cbc4b94472714868d1
- Pointer size: 131 Bytes
- Size of remote file: 356 kB
doc/CTR23-REG.pngAdded

Large File Pointer Details
- SHA256: d5fe221712963f565bc1b68bcc7c03f6fd50fd1f792b4096163d7a0bbcc93a11
- Pointer size: 131 Bytes
- Size of remote file: 350 kB
doc/Classifier.pngAdded

Large File Pointer Details
- SHA256: e38b847d6cf90c7b5a59af43b27cbf916f8ca46b5123ee1974be9d4487435f60
- Pointer size: 131 Bytes
- Size of remote file: 346 kB
doc/LimiX-Logo.pngAdded

Large File Pointer Details
- SHA256: 039f044b288b96cab8cae8f6d86ac7644c038df83d619474313035eeb264038a
- Pointer size: 131 Bytes
- Size of remote file: 868 kB
doc/LimiX_Summary.pngAdded

Large File Pointer Details
- SHA256: 4dbd0c53c170962d64732f01b6eb5d30653522ecea64dad22a724eb1deede619
- Pointer size: 131 Bytes
- Size of remote file: 821 kB
doc/MissingValueImputation.pngAdded

Large File Pointer Details
- SHA256: 338c5c4b7854aa136032ecc47490061f17a92db5ff27fdc0b7bb1151561e5ee9
- Pointer size: 131 Bytes
- Size of remote file: 111 kB
doc/Regression.pngAdded

Large File Pointer Details
- SHA256: 36a8cc83d58ca39986c5c6425078a4b30b5dfa54e4a7f4a8015503d1bd2c225b
- Pointer size: 131 Bytes
- Size of remote file: 288 kB
doc/TabArena-CLS.pngAdded

Large File Pointer Details
- SHA256: bdae555d4168833e979299267aac7cab1da1dafc7764f0542fd1b36a43652fdf
- Pointer size: 131 Bytes
- Size of remote file: 364 kB
doc/TabArena-REG.pngAdded

Large File Pointer Details
- SHA256: f0004b81cf249ce96a2148da47f04eafdd7ffc2ae4c185b07c3df3123076ae90
- Pointer size: 131 Bytes
- Size of remote file: 344 kB
doc/TabArena_REG.pngAdded

Large File Pointer Details
- SHA256: fcfe208b4294aeef743dbf0e4bd331aad3155de7f2569f06f3c51eed88519eb9
- Pointer size: 131 Bytes
- Size of remote file: 333 kB
doc/TabArena_lite_CLS.pngAdded

Large File Pointer Details
- SHA256: a92c189bbdfacdbd6229df72b269bb19e06759ec563dca3eaa3813123c7f4acc
- Pointer size: 131 Bytes
- Size of remote file: 341 kB
doc/TabZilla-CLS.pngAdded

Large File Pointer Details
- SHA256: 3c7e2c9e14a8416a2cc74909244d8ca1606ce6a68739e26c9402d64cfec7047f
- Pointer size: 131 Bytes
- Size of remote file: 367 kB
doc/Usage_tips.mdAdded+9
doc/Usage_tips_cn.mdAdded+10
doc/classification_tabarena_lite.pngAdded

Large File Pointer Details
- SHA256: 6c59a47a29e79aac87de8ad2a0787e28d3dfb4e3bf721dfc6deda332a0c747fd
- Pointer size: 131 Bytes
- Size of remote file: 149 kB
doc/regression_tabarena_lite.pngAdded

Large File Pointer Details
- SHA256: 730b9d9f2d3e1d7d4226ae3939bee03e54390cdf104e791014cbceea8879ee91
- Pointer size: 131 Bytes
- Size of remote file: 141 kB