You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,7 +213,7 @@ The list below contains the functionality that contributors are planning to deve
213
213
***Feature Engineering**
214
214
*[x] On-demand Transformations (On Read) (Beta release. See [RFC](https://docs.google.com/document/d/1lgfIw0Drc65LpaxbUu49RCeJgMew547meSJttnUqz7c/edit#))
215
215
*[x] Streaming Transformations (Alpha release. See [RFC](https://docs.google.com/document/d/1UzEyETHUaGpn0ap4G82DHluiCj7zEbrQLkJJkKSv4e8/edit))
216
-
*[] Batch transformation (In progress. See [RFC](https://docs.google.com/document/d/1964OkzuBljifDvkV-0fakp2uaijnVzdwWNGdz7Vz50A/edit))
216
+
*[x] Batch transformation (Completed via unified transformation system. See [Feature Transformation](https://docs.feast.dev/getting-started/architecture/feature-transformation))
217
217
*[x] On-demand Transformations (On Write) (Beta release. See [GitHub Issue](https://github.com/feast-dev/feast/issues/4376))
A *feature transformation* is a function that takes some set of input data and
4
-
returns some set of output data. Feature transformations can happen on either raw data or derived data.
3
+
A *feature transformation* is a function that takes some set of input data and returns some set of output data. Feature transformations can happen on either raw data or derived data. Feast provides a unified transformation system that allows you to define transformations once and apply them across different execution contexts.
4
+
5
+
## Unified Transformation System
6
+
7
+
Feast's unified transformation system centers around the `@transformation` decorator, which provides a single, consistent API for defining feature transformations. This decorator supports multiple execution modes, timing controls, and automatic feature view creation.
8
+
9
+
### Key Benefits
10
+
11
+
-**Single API**: Define transformations once using the `@transformation` decorator
12
+
-**Multiple Modes**: Support for Python, Pandas, SQL, Spark, Ray, and Substrait transformations
13
+
-**Execution Timing Control**: Choose when transformations run (on read, on write, batch, streaming)
14
+
-**Training-Serving Consistency**: Dual registration ensures the same transformation logic is used for training and serving
15
+
-**Automatic Feature View Creation**: Enhanced decorator can automatically create FeatureViews when provided with additional parameters
16
+
17
+
## Transformation Execution
5
18
6
-
## Feature Transformation Engines
7
19
Feature transformations can be executed by three types of "transformation engines":
8
20
9
-
1. The Feast Feature Server
10
-
2. An Offline Store (e.g., Snowflake, BigQuery, DuckDB, Spark, etc.)
3.**[A Compute Engine](../../reference/compute-engine/README.md)**: Executes transformations during batch processing or materialization
24
+
25
+
The choice of execution engine depends on the transformation timing (`when` parameter) and mode (`mode` parameter).
12
26
13
-
The three transformation engines are coupled with the [communication pattern used for writes](write-patterns.md).
27
+
## The @transformationDecorator
14
28
15
-
Importantly, this implies that different feature transformation code may be
16
-
used under different transformation engines, so understanding the tradeoffs of
17
-
when to use which transformation engine/communication pattern is extremely critical to
18
-
the success of your implementation.
29
+
The `@transformation` decorator is the primary API for defining feature transformations in Feast. It provides both backward compatibility with existing transformation patterns and new enhanced capabilities.
19
30
20
-
In general, we recommend transformation engines and network calls to be chosen by aligning it with what is most
21
-
appropriate for the data producer, feature/model usage, and overall product.
31
+
### Basic Usage (Backward Compatible)
32
+
33
+
```python
34
+
from feast.transformation import transformation, TransformationMode
`feature_transformation` or `udf` are the core APIs for defining feature transformations in Feast. They allow you to specify custom logic that can be applied to the data during materialization or retrieval. Examples include:
53
+
The decorator supports additional parameters that enable automatic FeatureView creation and advanced execution control:
54
+
55
+
```python
56
+
from feast.transformation import transformation, TransformationTiming
57
+
58
+
@transformation(
59
+
mode="pandas",
60
+
when="on_read", # Execute during feature retrieval
61
+
online=True, # Enable dual registration for training-serving consistency
62
+
sources=[driver_hourly_stats_view],
63
+
schema=[
64
+
Field(name="conv_rate_adjusted", dtype=Float64),
65
+
Field(name="efficiency_score", dtype=Float64)
66
+
],
67
+
entities=[driver_entity],
68
+
name="driver_metrics_enhanced",
69
+
description="Enhanced driver metrics with efficiency scoring"
3.**Simplified Management**: One decorator handles all transformation contexts
382
+
4.**Better Maintainability**: Changes only need to be made in one place
383
+
5.**Flexible Execution**: Easy to change timing (`when` parameter) without rewriting logic
384
+
67
385
### Aggregation
68
386
Aggregation is builtin API for defining batch or streamable aggregations on data. It allows you to specify how to aggregate data over a time window, such as calculating the average or sum of a feature over a specified period. Examples include:
0 commit comments