File size: 1,342 Bytes
4f0dca6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae42959
4f0dca6
ae42959
4f0dca6
 
 
ae42959
4f0dca6
 
 
 
ae42959
4f0dca6
ae42959
 
 
 
 
 
 
 
 
 
 
 
 
4f0dca6
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
license: openmdw-1.1
tags:
- tabular-foundation-model
- structured-data-models
---

# Kumo Tabular

Kumo Tabular is NVIDIA's pretrained tabular foundation model for classification and regression.

## Getting Started

Install [`structured-data-models`](https://github.com/NVIDIA/structured-data-models) for inference:

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

Use labeled examples as context to predict class probabilities for new data:

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

import sdm

df = load_breast_cancer(as_frame=True).frame
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

table = sdm.TableTensor.from_pandas(
    df=df,
    stypes=sdm.infer_stypes(df, overrides={"target": "categorical"}),
    device=device,
)
model = sdm.models.KumoTabular(task="classification", device=device)

with torch.amp.autocast(
    device.type,
    dtype=torch.float16,
    enabled=device.type == "cuda",
):
    probs = model(
        x_context=table[:300].drop_columns("target"),
        y_context=table[:300, "target"],
        x_query=table[300:].drop_columns("target"),
        num_estimators=8,
    )

print(probs)
```

To learn more, visit [structured-data-models](https://github.com/NVIDIA/structured-data-models).

## License

Kumo Tabular weights are released under OpenMDW 1.1.