[Beta] On demand feature view
Warning: This is an experimental feature. To our knowledge, this is stable, but there are still rough edges in the experience. Contributions are welcome!
Overview
On Demand Feature Views (ODFVs) allow data scientists to use existing features and request-time data (features only available at request time) to transform and create new features. Users define Python transformation logic which is executed during both historical retrieval and online retrieval. Additionally, ODFVs provide flexibility in applying transformations either during data ingestion (at write time) or during feature retrieval (at read time), controlled via the write_to_online_store
parameter.
By setting write_to_online_store=True
, transformations are applied during data ingestion, and the transformed features are stored in the online store. This can improve online feature retrieval performance by reducing computation during reads. Conversely, if write_to_online_store=False
(the default if omitted), transformations are applied during feature retrieval.
Why use on demand feature views?
This enables data scientists to easily impact the online feature retrieval path. For example, a data scientist could
Call
get_historical_features
to generate a training dataframeIterate in notebook on feature engineering in Pandas/Python
Copy transformation logic into ODFVs and commit to a development branch of the feature repository
Verify with
get_historical_features
(on a small dataset) that the transformation gives expected output over historical dataDecide whether to apply the transformation on writes or on reads by setting the
write_to_online_store
parameter accordingly.Verify with
get_online_features
on dev branch that the transformation correctly outputs online featuresSubmit a pull request to the staging / prod branches which impact production traffic
CLI
There are new CLI commands:
feast on-demand-feature-views list
lists all registered on demand feature view afterfeast apply
is runfeast on-demand-feature-views describe [NAME]
describes the definition of an on demand feature view
Example
See https://github.com/feast-dev/on-demand-feature-views-demo for an example on how to use on demand feature views.
Registering transformations
On Demand Transformations support transformations using Pandas and native Python. Note, Native Python is much faster but not yet tested for offline retrieval.
When defining an ODFV, you can control when the transformation is applied using the write_to_online_store parameter:
write_to_online_store=True
: The transformation is applied during data ingestion (on write), and the transformed features are stored in the online store.write_to_online_store=False
(default when omitted): The transformation is applied during feature retrieval (on read).
We register RequestSource
inputs and the transform in on_demand_feature_view
:
Example of an On Demand Transformation on Read
Example of an On Demand Transformation on Write
Then to ingest the data with the new feature view make sure to include all of the input features required for the transformations:
Feature retrieval
The on demand feature view's name is the function name (i.e. transformed_conv_rate
).
Offline Features
And then to retrieve historical, we can call this in a feature service or reference individual features:
Online Features
And then to retrieve online, we can call this in a feature service or reference individual features:
Last updated