In use-cases like search one might need to apply a model to multiple entries at runtime. Having a single query is much more resilient than one per product. Does feast support it?
Asked
Active
Viewed 441 times
1 Answers
1
In this scenario, the "feature service" component of the Feast can be utilized to pull data from one or more feature views. This makes it possible to fetch multiple features in a single call.
For example, let's say we have multiple feature views -
- Feature view for demographics data
demographics_fv = FeatureView(
name="demographics_fv",
entities=[cust_id],
ttl=timedelta(days=365),
schema=[
Field(name="gender", dtype=String),
Field(name="age", dtype=Int32),
Field(name="location", dtype=String),
],
online=True,
source=cust_data,
tags={}
)
- Feature view for medical data
medical_fv = FeatureView(
name="medical_fv",
entities=[cust_id],
ttl=timedelta(days=365),
schema=[
Field(name="weight", dtype=Int32),
Field(name="height", dtype=Int32),
Field(name="blood_group", dtype=String),
],
online=True,
source=cust_data,
tags={}
)
A feature service definition can be created that will consist references to multiple feature views -
cust_data_fs = FeatureService(
name="cust_data_fs",
features=[demographics_fv, medical_fv[["weight", "height"]]]
)
Now a call can be made to this feature service to retrieve required data that may be coming from one or more feature views -
feature_service = feature_store.get_feature_service("cust_data_fs")
feature_store.get_historical_features(features=feature_service, entity_df=entity_df)
You can find more details on this link: https://docs.feast.dev/getting-started/concepts/feature-retrieval#feature-services

skt7
- 1,197
- 8
- 21
-
What about when two featureView are from different datasource? For example I have user_df, item_df, rating_df. rating_df consists of user_id and item_id. I want to add user and item features to rating_df, how could I achieve this is feast? I've thought about joining everything then loading it to feature_store than creating featureView from joined dfs(now a data source) but then this means I need to do joins by myself... – haneulkim Jan 13 '23 at 04:46