torch_frame

The semantic type of a column.

A semantic type denotes the semantic meaning of a column, and denotes how columns are encoded into an embedding space within tabular deep learning models:

import torch_frame

stype = torch_frame.numerical  # Numerical columns
stype = torch_frame.categorical  # Categorical columns
...
numerical

Numerical columns.

categorical

Categorical columns.

text_embedded

Pre-computed embeddings of text columns.

text_tokenized

Tokenized text columns for finetuning.

multicategorical

Multicategorical columns.

sequence_numerical

Sequence of numerical values.

embedding

Embedding columns.

timestamp

Timestamp columns.

image_embedded

Pre-computed embeddings of image columns.

class Metric(value)[source]

The metric.

ACCURACY

accuracy

ROCAUC

rocauc

RMSE

rmse

MAE

mae

class TaskType(value)[source]

The type of the task.

REGRESSION

Regression task.

MULTICLASS_CLASSIFICATION

Multi-class classification task.

BINARY_CLASSIFICATION

Binary classification task.

class NAStrategy(value)[source]

Strategy for dealing with NaN values in columns.

MEAN

Replaces NaN values with the mean of a torch_frame.numerical column.

ZEROS

Replaces NaN values with zeros in a torch_frame.numerical column.

MOST_FREQUENT

Replaces NaN values with the most frequent category of a torch_frame.categorical column.