Creating a Feature Service to Group the Features Together
Your feature repository now has five features. You created the
user_credit_card_issuer
, user_transaction_counts
,
transaction_amount_is_high
, and transaction_distance_from_home
features. The
feature user_home_location
, was already defined. In this topic, you will
create a Feature Service that groups these features together.
In your local feature repository, open the file
feature_services/fraud_detection.py
. In the file, uncomment the following
code, which is a definition of the Feature Service.
from tecton import FeatureService
from features.batch_features.user_credit_card_issuer import user_credit_card_issuer
from features.batch_features.user_transaction_counts import user_transaction_counts
from features.batch_features.user_home_location import user_home_location
from features.on_demand_features.transaction_amount_is_high import (
transaction_amount_is_high,
)
from features.on_demand_features.transaction_distance_from_home import (
transaction_distance_from_home,
)
fraud_detection_feature_service = FeatureService(
name="fraud_detection_feature_service",
online_serving_enabled=True,
features=[
user_credit_card_issuer,
transaction_amount_is_high,
user_transaction_counts,
user_home_location,
transaction_distance_from_home,
],
)
The features
list, shown above, contains the features to include in the
feature service. online_serving_enabled
is set to True
to allow features to
be retrieved from the online store.
In your terminal, run tecton apply
to apply this Feature Service to your
workspace.
Now that you have created the Feature Service, you are ready to proceed to the next part of this tutorial. In the next part, you will call the Feature Service to read feature data for training and inference, at which time you will see the output.