structured-data-models README

项目的 README,来自 github.com/NVIDIA/structured-data-models。合并为一个 markdown 文件:README.md。

Structured Data Models

Python 3.11+ License: Apache 2.0 Contributions Welcome Docs

A GPU-native library of foundation models, tensor subclasses, and data processors for structured data.

Installation

The structured-data-models package is available from Python 3.11 and PyTorch 2.7 onwards. Install from PyPI:

pip install structured-data-models

Alternatively, install from main via:

pip install git+https://github.com/NVIDIA/structured-data-models.git

[!NOTE] For CUDA workloads, we highly recommend installing cudf as an additional dependency to keep dataframe-style operations on GPU and avoid unnecessary data movement.

Model Families

Tabular Foundation Models:

Relational Foundation Models:

Times Series Forecasting Foundation Models:

Times Series Anomaly Detection Foundation Models:

Quick Tour

from sklearn.datasets import load_breast_cancer

import sdm

df = load_breast_cancer(as_frame=True).frame

# A lossless, fully tensorized representation of the raw data on GPU:
table = sdm.TableTensor.from_pandas(
    df=df,
    stypes=sdm.infer_stypes(df, overrides={"target": "categorical"}),
    device="cuda",
)

# Access to a variety of pre-trained structured data models:
model = sdm.models.KumoTabular(device="cuda")

# Default in-context learning forward pass:
model(
    x_context=table[:300].drop_columns("target"),
    y_context=table[:300, "target"],
    x_query=table[300:].drop_columns("target"),
    num_estimators=8,
)

# Fit + Predict forward pass via key/value caching for fast inference:
model.fit(
    x=table[:300].drop_columns("target"),
    y=table[:300, "target"],
    num_estimators=8,
)
model.predict(table[300:].drop_columns("target"))
model.clear()

Additional examples are available in examples/. Benchmarks for reproducing reported results live in benchmark/.

Notice and Disclaimer

This software automatically retrieves, accesses or interacts with external materials. Those retrieved materials are not distributed with this software and are governed solely by separate terms, conditions and licenses. You are solely responsible for finding, reviewing and complying with all applicable terms, conditions, and licenses, and for verifying the security, integrity and suitability of any retrieved materials for your specific use case. This software is provided "AS IS", without warranty of any kind. The author makes no representations or warranties regarding any retrieved materials, and assumes no liability for any losses, damages, liabilities or legal consequences from your use or inability to use this software or any retrieved materials. Use this software and the retrieved materials at your own risk.

License

The NVIDIA-authored source code is licensed under the Apache License 2.0. Third-party software and separately distributed model assets are documented in THIRD_PARTY_LICENSES.md:

structured-data-models (NVIDIA/structured-data-models)

正在搜索数据库…

这是什么?Structured Data Models(SDM)是一个基于 GPU 原生设计的库,提供基础模型、张量子类和数据处理器,用于处理表格、关系数据库和时间序列等结构化数据。
这是我可以导入的库,还是独立应用?这是一个 Python 库,通过 PyPI 安装后导入到你自己的代码中。它提供模型实现、与 PyTorch 兼容的张量类型以及预处理工具,而不是独立应用。
安装前我需要准备什么?需要 Python 3.11+ 和 PyTorch 2.7+。如果使用 CUDA 工作负载,建议额外安装 cudf,以便让数据框操作在 GPU 上运行。
要运行得好,是否必须有 GPU?该库的定位是 GPU 原生,因此虽然可能在 CPU 上运行,但从其设计和对 cudf 的推荐可以看出,GPU 加速才是获得完整性能的预期方式。
它包含哪些类型的模型?它涵盖三大类:表格模型(TabICLv2、TabFM、KumoTabular)、关系模型(KumoRelational),以及时间序列模型,其中包括用于预测的 KumoForecast、TimesFM3 和用于异常检测的 KumoAnomaly。
我能直接使用 TabICLv2 或 TimesFM3 吗?可以。该库提供了基于统一模型接口构建的参考实现,因此你可以直接从包中加载并使用 TabICLv2、TabFM、KumoRelational、KumoForecast、TimesFM3 和 KumoAnomaly 等模型。
有入门示例吗?有。examples/ 目录中提供了更多使用示例,benchmark/ 目录中则包含用于复现已发表结果的基准测试。
这个库也能处理数据预处理吗?可以。除了模型本身,它还包含可组合、可扩展且支持 GPU 加速的预处理和后处理工具,用于结构化数据工作流。
作者
NVIDIA
大小
45.4 MB
星标
493
时长
5个月
提交 · 90 天