torch_frame.transforms.BaseTransform

class BaseTransform[source]

Bases: ABC

An abstract base class for writing transforms.

Transforms are a general way to modify and customize TensorFrame

abstract forward(tf: TensorFrame) TensorFrame[source]

Process TensorFrame obj into another TensorFrame obj.

Parameters:

tf (TensorFrame) – Input TensorFrame.

Returns:

Input TensorFrame after transform.

Return type:

TensorFrame

property transformed_stats: dict[str, dict[torch_frame.data.stats.StatType, Any]]

The column stats after the transform.

Returns:

Transformed column stats. The TensorFrame object might be modified by the transform, so the returned transformed_stats would contain the column stats of the modified TensorFrame object.

Return type:

transformed_stats (Dict[str, Dict[StatType, Any]])