Skip to content

Feature Request Lifecycle

Suppose you are trying to detect fraud and want to know if the user's transaction amount is suspiciously high. You create two features:

  • transaction_amounts: Calculates the user's average transaction amount over the past 24 hours. This feature also performs other calculations, but they are out of scope for this example.

  • amount_is_higher_than_avg: Calculates if the user's current transaction amount is higher than the user's average transaction amount over the past 24 hours. This feature uses the transaction_amounts feature.

The following diagram illustrates how data flows through the feature platform when the two features are requested. Note that all of the components of the feature platform are not shown.

Feature Data Flow

The following steps occur when the amount_is_higher_than_avg feature is requested:

  1. The request for amount_is_higher_than_avg is received by the serving layer of the feature store, which begins to retrieve the feature vector.

  2. To determine if the transaction amount is high, amount_is_higher_than_avg needs to get the value of the transaction_amounts feature, which contains the average transaction amount over the last 24 hours.

    2a. The feature value for transaction_amounts has already been pre-computed by the feature pipelines layer. With materialization enabled, the feature pipelines layer continuously computes updated feature values from the stream and batch data sources and writes updated values to the storage layer of the feature store.

  3. Finally, the serving layer of the feature store reads the transaction_amounts pre-computed value and combines it with data provided with the request (the current transaction amount) and returns, to the caller, whether the transaction amount is high.