Definition of the feature store
In a machine learning model, a feature is an input variable: the age of an account, the number of purchases a customer has made over thirty days. A feature store is the component that records the definition of these features, stores their values and serves them to models, for training as well as in production. The term comes from usage.
The documentation of the open source project Feast presents its feature store as made up of two elements: an offline store, from which the history used for training is extracted, and an online store, which serves features with low latency in production. That of Hopsworks, another open source project, likewise distinguishes a low-latency online interface and a high-throughput offline interface, used to build training data.
The flaw it targets: two calculations for the same feature
Without a shared component, the same feature can be calculated twice. Once over the history, to train the model. A second time in the application code, at prediction time. The two versions can diverge, on the time window used or on the handling of a missing value. The model then receives inputs in production that no longer resemble those of its training (training-serving skew).
A second flaw relates to dates. A training dataset associates with each example the value the feature had at that moment. Slipping in a value known only later distorts the model’s evaluation. Feast and Hopsworks document point-in-time joins for this purpose, which exclude values later than the date of the example.
What a feature store is made of
- A registry of definitions: feature name, entity described, source. It plays the role of a data catalogue for features and allows them to be reused from one model to another.
- An offline store, which keeps the timestamped history of values. It can rely on the data warehouse or the lakehouse already in place.
- An online store, which keeps ready, for each entity, the values to serve at prediction time.
- An access service, queried in batches for training and one item at a time for prediction.
The calculation of values remains upstream. Feast states that it is neither an ETL or ELT system nor a processing orchestrator.
The case of a live events ticketing site
Take an online live events ticketing site that recommends events to its visitors. One of the model’s features is the number of tickets bought by the visitor over thirty days. For training, the offline store returns, for each past visit, the value this feature had at the time of the visit. In production, the online store provides the current value while the page is being displayed.
When another team prepares a model to detect abusive resale, it finds the feature in the registry and reuses it.
Feature store, data warehouse, model registry: not to be confused
The Feast documentation rules out the first confusion: Feast does not replace the data warehouse, it forms a lightweight downstream layer, which serves the data held there to models.
The model registry keeps the versions of trained models and their status, as our entry MLOps explains. The feature store keeps their inputs. Feast states that it does not fully cover experiment management, nor does it version datasets, and cites tools such as MLflow or Kubeflow for these needs.
When a feature store is too much
A feature store adds two stores to synchronise and a service to operate. For a model run in batches, whose features are used by no other model, a versioned feature table in the data warehouse may be enough. Nor does it correct the data it receives: a wrong source gives a wrong feature.
The feature store is one of the building blocks of a broader pipeline, presented in our page MLOps and LLMOps, from versioning to drift monitoring.