Skip to navigation

SDM Library Documentation

View as MarkdownOpen in Claude

Structured Data Models (SDM) is an open source PyTorch library that loads pretrained Kumo foundation models and runs them in your own Python process. You work directly with the models, their tensors, and their preprocessing.

When to Use SDM

Use SDM when you want the following:

  • The model in your process. Weights load into your Python process and run on your CPU or GPU. Your data does not leave your environment.
  • Direct control. You build the tensors, choose the context, tune the recipe and ensemble, sample related tables yourself, and can fine-tune the weights.
  • Time series models. Kumo Forecast and Kumo Anomaly run through Kumo-TS, a companion library that SDM’s installation and guides cover.
  • Baselines. SDM includes reference implementations of other published tabular models, TabICLv2 and TabFM, behind the same interface.

Use the SDM Client library instead when a Kumo Tabular or Kumo Relational NIM is already deployed, or when you want to describe tasks in Predictive Query Language and sample related tables from a warehouse in place.

To compare the models themselves, refer to Compare Models.

How SDM Works

The following diagram shows how your data flows through a pretrained 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.

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.

Kumo Tabular and Kumo Relational follow the same workflow in SDM:

  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.
  4. Read the predictions, returned as a TableTensor that converts back to pandas.

Each model ships a recipe for preprocessing and postprocessing, and averages several randomized passes (num_estimators) for stability. You can adjust both. The models share one interface, so you can swap one for another, or for a baseline, on the same data.

User Guide

Continue with one of the following pages:

For constructor and forward parameters of every model, refer to the API reference.