Search…
Feature service
A feature service is an object that represents a logical group of features from one or more feature views. Feature Services allows features from within a feature view to be used as needed by an ML model. Users can expect to create one feature service per model, allowing for tracking of the features used by models.
driver_trips_feature_service.py
1
from driver_ratings_feature_view import driver_ratings_fv
2
from driver_trips_feature_view import driver_stats_fv
3
4
driver_stats_fs = FeatureService(
5
name="driver_activity",
6
features=[driver_stats_fv, driver_ratings_fv[["lifetime_rating"]]]
7
)
Copied!
Feature services are used during
    The generation of training datasets when querying feature views in order to find historical feature values. A single training dataset may consist of features from multiple feature views.
    Retrieval of features from the online store. The features retrieved from the online store may also belong to multiple feature views.
Applying a feature service does not result in an actual service being deployed.
Feature services can be retrieved from the feature store, and referenced when retrieving features from the online store.
1
from feast import FeatureStore
2
feature_store = FeatureStore('.') # Initialize the feature store
3
4
feature_service = feature_store.get_feature_service("driver_activity")
5
features = feature_store.get_online_features(
6
features=feature_service, entity_rows=[entity_dict]
7
)
Copied!
Feature services can also be used when retrieving historical features from the offline store.
1
from feast import FeatureStore
2
feature_store = FeatureStore('.') # Initialize the feature store
3
4
feature_service = feature_store.get_feature_service("driver_activity")
5
feature_store.get_historical_features(features=feature_service, entity_df=entity_df)
Copied!
Last modified 10d ago
Export as PDF
Copy link