Skip to content

featurebyte.FeatureList.compute_historical_feature_table

compute_historical_feature_table(
observation_set: Union[ObservationTable, DataFrame],
historical_feature_table_name: str,
serving_names_mapping: Union[Dict[str, str], NoneType]=None
) -> HistoricalFeatureTable

Description

Materialize feature list using an observation table asynchronously. The historical features will be materialized into a historical feature table.

Parameters

  • observation_set: Union[ObservationTable, DataFrame]
    Observation set with POINT_IN_TIME and serving names columns. This can be either an ObservationTable or a pandas DataFrame.

  • historical_feature_table_name: str
    Name of the historical feature table to be created

  • serving_names_mapping: Union[Dict[str, str], NoneType]
    Optional serving names mapping if the training events table has different serving name

Returns

  • HistoricalFeatureTable

Examples

>>> # Get the desired observation table
>>> observation_table = catalog.get_observation_table(<observation_table_name>)
>>> # Get the desired feature list
>>> my_feature_list = catalog.get_feature_list(<feature_list_name>)
>>> # Decide the name of the historical feature table
>>> training_table_name = (
...   '2y Features for Customer Purchase next 2w '
...   'up to end 22 with Improved Feature List'
... )
>>> # Compute the historical feature table
>>> training_table = my_feature_list.compute_historical_feature_table(
...   observation_table=observation_table,
...   historical_feature_table_name=training_table_name
...   serving_names_mapping={"GROCERYCUSTOMERGUID": "CUSTOMERGUID"}
... )