Principle:Snorkel team Snorkel Transformation Function Definition
| Knowledge Sources | |
|---|---|
| Domains | Data_Augmentation, Data_Programming |
| Last Updated | 2026-02-14 20:00 GMT |
Overview
A mechanism for defining data transformation operations that generate augmented training examples by modifying existing data points.
Description
Transformation Function Definition extends the data programming paradigm to data augmentation. A transformation function (TF) takes a data point and returns either a modified version of it (creating an augmented example) or None (indicating the transformation was not applicable).
Unlike labeling functions which produce labels, TFs produce new data points. They share the same Mapper infrastructure, supporting:
- Field mapping and renaming
- Preprocessor chains
- Result caching (memoization)
- Deep copy of data points to avoid mutation
TFs can implement any data modification: text paraphrasing, synonym replacement, random insertion/deletion, image transformations, etc.
Usage
Use this principle when you want to programmatically augment your training data. Define TFs that create meaningful variations of your data while preserving labels. Combine multiple TFs through augmentation policies.
Theoretical Basis
A transformation function maps data points to modified versions:
where (None) indicates the transformation was not applicable. The augmented dataset is:
The label is preserved since the transformation should not change the semantic class.