> This page is for Structured Data Models.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/sdgm/llms.txt.

# Overview

> Run pretrained foundation models on tables, related tables, and time series in Python.

[**Structured Data Models**](https://github.com/NVIDIA/structured-data-models) (`sdm`) is an open source PyTorch library for pretrained foundation models on structured data.
You give a model labeled example rows at inference time, and it predicts new rows in a single forward pass, with no task-specific training.

#### [Kumo Tabular](/sdgm/structured-data-models/models/kumo-tabular)

Classification and regression on one table of numerical and categorical features.

#### [Kumo Relational](/sdgm/structured-data-models/models/kumo-relational)

Classification and regression using rows linked across tables by keys.

#### [Kumo Forecast](/sdgm/structured-data-models/models/kumo-forecast)

Forecast future values of one or more series, with optional past covariates.

#### [Kumo Anomaly](/sdgm/structured-data-models/models/kumo-anomaly)

Score and flag unusual time steps in multivariate series, with no labels.

## Run Your First Prediction

This example classifies breast tumors from 30 numerical features with Kumo Tabular.
It runs on a CPU, needs no Hugging Face account, and downloads about 115 MB of weights on first use.

```bash
pip install structured-data-models
```

```python
import torch
from sklearn.datasets import load_breast_cancer

import sdm
from sdm.evaluation import to_class_indices

device = "cuda" if torch.cuda.is_available() else "cpu"

# 1. Load a table and declare column semantic types
df = load_breast_cancer(as_frame=True).frame
table = sdm.TableTensor.from_pandas(
    df=df,
    stypes=sdm.infer_stypes(df, overrides={"target": "categorical"}),
    device=device,
)
context, query = table[:300], table[300:]

# 2. Load pretrained Kumo Tabular (weights download on first use)
model = sdm.models.KumoTabular(task="classification", size="small", device=device)

# 3. Predict query rows from labeled context rows, with no training
probs = model(
    x_context=context.drop_columns("target"),
    y_context=context["target"],
    x_query=query.drop_columns("target"),
    num_estimators=8,
    generator=torch.Generator(device=device).manual_seed(0),
)
print(probs.to_pandas().head(3))

# 4. Score the predictions
scores, labels = to_class_indices(probs, query["target"])
accuracy = (scores.argmax(dim=-1) == labels).float().mean()
print(f"Accuracy: {accuracy:.3f}")
```

**`Expected output`**

```text title="Expected output"
          0         1
0  0.999958  0.000042
1  0.000192  0.999808
2  0.999905  0.000095
Accuracy: 0.974
```

Each output column holds the probability of one class, named by its label.
The model used 300 labeled rows as context and predicted the other 269.
To run regression, reuse context across batches, and move to a GPU, continue with the [Quickstart](/sdgm/structured-data-models/quickstart).

## Model Portfolio

NVIDIA publishes four Kumo foundation models in the [NVIDIA Kumo Structured collection](https://huggingface.co/collections/nvidia/nvidia-kumo-structured).
Kumo Tabular and Kumo Relational run in SDM; Kumo Forecast and Kumo Anomaly run in Kumo-TS.
All four download their weights from Hugging Face on first use.

| Model           | Kumo Tabular                                             | Kumo Relational                                                     | Kumo Forecast                                                                             | Kumo Anomaly                                                     |
| --------------- | -------------------------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| Task            | Classification, regression                               | Classification, regression                                          | Multivariate forecasting                                                                  | Anomaly detection                                                |
| Labels needed   | Labeled context rows                                     | Labeled context rows                                                | Past values of the target series                                                          | None                                                             |
| Input           | One table: context rows with targets, query rows without | Task rows plus related tables, key relationships, and one task link | DataFrame with a timestamp, a target, and optional numeric covariates (at least 512 rows) | DataFrame of numeric sensor columns                              |
| Output          | Class probabilities, or 999 quantiles for regression     | Class probabilities, or 999 quantiles for regression                | Future timestamps and a `<target>_forecast` column                                        | Input columns plus `Anomaly` (0 or 1) and an `MAE` score         |
| Parameters      | 27.46M to 215.68M (small, medium, large)                 | 29.93M to 30.94M                                                    | See the [model card](https://huggingface.co/nvidia/Kumo-Forecast)                         | See the [model card](https://huggingface.co/nvidia/Kumo-Anomaly) |
| Weights license | OpenMDW-1.1                                              | OpenMDW-1.1, with BSD-3-Clause notice                               | Apache-2.0                                                                                | Apache-2.0                                                       |
| Entry point     | `sdm.models.KumoTabular`                                 | `sdm.models.KumoRelational`                                         | `perform_forecasting`                                                                     | `perform_anomaly_analysis_with_diffusion`                        |
| Library         | SDM (`pip install structured-data-models`)               | SDM (`pip install structured-data-models`)                          | Kumo-TS, Kumo-Forecast package                                                            | Kumo-TS, Kumo-Anomaly package                                    |

SDM also includes reference implementations of other published tabular models, TabICLv2 and TabFM, which are useful as baselines.
Check each model's weights license in the [model overview](https://nvidia.github.io/structured-data-models/api/models.html); some are non-commercial.

## Which Model Should I Use?

Answer two questions to find the model that fits your data.

Use [Kumo Tabular](/sdgm/structured-data-models/models/kumo-tabular).
Pass labeled rows as context and the rows to score as queries.

Use [Kumo Relational](/sdgm/structured-data-models/models/kumo-relational).
Describe the tables and their keys with `RelatedTables`.

Use [Kumo Forecast](/sdgm/structured-data-models/models/kumo-forecast).
Set how many steps to predict with `forecast_horizon`.

Use [Kumo Anomaly](/sdgm/structured-data-models/models/kumo-anomaly).
Pass the series directly, with no context rows or labels.

The same guidance as a table:

| If your data looks like                                                                         | Use                                                               | Why                                                                                        |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| One row per example, features in columns, a label to predict                                    | [Kumo Tabular](/sdgm/structured-data-models/models/kumo-tabular)       | Single-table classification or regression from labeled context rows.                       |
| Entities plus event or transaction tables linked by IDs (users and orders, patients and visits) | [Kumo Relational](/sdgm/structured-data-models/models/kumo-relational) | Reads related rows through key relationships, so you do not hand-build aggregate features. |
| Already flattened into one wide table                                                           | [Kumo Tabular](/sdgm/structured-data-models/models/kumo-tabular)       | Use Kumo Relational when the flattening loses information you care about.                  |
| Ordered measurements over time, and you want future values                                      | [Kumo Forecast](/sdgm/structured-data-models/models/kumo-forecast)     | Rows are time steps; `forecast_horizon` sets how many steps to predict.                    |
| Ordered measurements over time, and you want unusual points flagged                             | [Kumo Anomaly](/sdgm/structured-data-models/models/kumo-anomaly)       | Unsupervised: no labels, returns a score and a 0 or 1 flag per time step.                  |

## How SDM Works

The models in SDM are foundation models for structured data.
Each one is pretrained once and is task agnostic: adding a prediction task means passing new rows, not training and maintaining another model.

![Your tables from pandas, Arrow, or cuDF are loaded into a TableTensor with a semantic type per column. Its rows split into context rows with known targets and query rows with unknown targets, which go into a pretrained foundation model. Inside the model, a recipe preprocesses the data, an ensemble of frozen estimators set by num\_estimators runs, and the recipe postprocesses the outputs. Predictions return as probabilities or quantiles for each query row.](/sdgm/_fern-files/nvidia-sdgm.docs.buildwithfern.com/61b4b8887d728bc8f64bee4fc4187420177a93dfe26602e2046837a33b081fd6/_dot_dot_/images/structured-data-models/how_sdm_works_light.svg)

![Your tables from pandas, Arrow, or cuDF are loaded into a TableTensor with a semantic type per column. Its rows split into context rows with known targets and query rows with unknown targets, which go into a pretrained foundation model. Inside the model, a recipe preprocesses the data, an ensemble of frozen estimators set by num\_estimators runs, and the recipe postprocesses the outputs. Predictions return as probabilities or quantiles for each query row.](/sdgm/_fern-files/nvidia-sdgm.docs.buildwithfern.com/38905e8d3859866550d461d9b52769f99114e0e8ddf21fda87f7d47e0842975c/_dot_dot_/images/structured-data-models/how_sdm_works_dark.svg)

Every model that runs in SDM follows the same workflow:

1. Load your data from pandas, Arrow, or cuDF as a `TableTensor`, which records a semantic type for each column.
2. Split its rows into *context rows*, whose outcome you already know, and *query rows* you want predicted.
3. Pass both to a pretrained model. For Kumo Relational, also pass the linked tables and their keys as `RelatedTables`. The model reads the context and predicts the query rows in one forward pass, much like an LLM answers from examples in its prompt, and its weights never change.
4. Read the predictions, returned as a `TableTensor` that converts back to pandas.

[In-Context Learning](/sdgm/about-nvidia-kumo/in-context-learning) explains how the models reason over context and how they are pretrained.

* **No training pipeline.** There is no training run, hyperparameter search, or retraining schedule. When your data changes, pass the new rows as context.
* **Accurate on small, messy data.** Pretraining gives the models a strong prior about how tables behave, so they predict well from a few hundred labeled rows and tolerate missing values.
* **Swap models freely.** Kumo Tabular, Kumo Relational, and baselines such as TabICLv2 share one interface, so you can compare them on the same data. Kumo Forecast and Kumo Anomaly apply the same pretrained approach to time series.
* **Defaults you can tune.** Each model ships a *recipe* for preprocessing and postprocessing, and averages several randomized passes (`num_estimators`) for stability. You can adjust both.

> **Need a hosted endpoint instead?**
>
> Kumo Tabular and Kumo Relational are also available as NVIDIA NIM microservices.
> Use the [Structured Data Models Client](/sdgm/client/overview) tab to send requests to a deployed endpoint without loading weights in your process.

## Next Steps

#### [Quickstart](/sdgm/structured-data-models/quickstart)

Run classification and regression, reuse context, and move to a GPU.

#### [Installation](/sdgm/structured-data-models/installation)

Python and PyTorch requirements, GPU setup, weight caching, and offline use.

#### [API Reference](https://nvidia.github.io/structured-data-models/api/models.html)

Constructor and forward parameters for every model.