DATA ARCHITECTURE

ML Feature & Feature-Store Modeling

Chapter 20Specialized & AppliedML

Orientation

What You'll Master Here

Machine learning models do not consume raw tables, they consume features: numeric or categorical signals about an entity, computed from your data. Modeling features well is a distinct discipline with one subtle, dominant concern: time. Get the time dimension wrong and your model looks brilliant in testing and fails in production.

You will learn what a feature actually is (an entity, a value, and an as-of timestamp), the cardinal rule of point-in-time correctness that prevents data leakage, the training-serving skew that silently degrades models, and the feature store that keeps offline training and online serving consistent.

This chapter assumes no ML background, it is about the data modeling of features, not the math. Everything is shown with concrete as-of joins and feature definitions, because feature bugs are almost always data-modeling bugs about time, not algorithm bugs.

Why it matters

Most ML production failures are feature problems: leakage that inflates offline accuracy, or skew that makes serving differ from training. These are data-modeling mistakes, and this chapter is how you avoid them.

Core mental model

A feature is a value about an entity AS OF a point in time. Modeling features is mostly about getting that timestamp right.

Key terms
feature
A signal about an entity used by a model (e.g. orders_last_30d for a customer).
point-in-time correctness
Using each feature’s value as it was at the label’s timestamp, never later.
data leakage
Letting future information into training, inflating offline accuracy unrealistically.
feature store
A system serving consistent features to both training (offline) and serving (online).

Common mistake

Computing features with "current" values for historical training rows.

Future information leaks into the past; the model scores great offline and fails live.

Better habit

  • Tag every feature with the entity and the as-of timestamp.
  • Join features as of the label time, never the current value.
  • Compute a feature one way for both training and serving.
The big idea

Feature modeling is temporal modeling for ML. The hard part is always "as of when?", the answer must be the label’s time, not now.

How to study this chapter

Hold one example: predicting churn on March 10. Every feature must be as it was on March 10, not as it is today. That single rule organizes the chapter.

Practice prompts

  • Define a feature for a churn model and state its entity and grain.
  • Explain why "as of when?" is the central feature question.

Remember this

Features are entity values as of a point in time; modeling them well is mostly about time, point-in-time correctness and training-serving consistency prevent the most common ML failures.