Data & Feature Management
The data side of the system, managed like a product
Data versioning, feature stores and train/serve consistency keep a model's inputs trustworthy: the same feature computed in training and in production, immutable dataset snapshots, and a 'feature as a service' contract.
What you will learn
- Version datasets and features like you version code
- Explain train/serve skew and how a feature store defeats it
- Design feature definitions once and serve them everywhere
What is this?
Data and feature management is everything that keeps a model's inputs correct and reusable: immutable, versioned dataset snapshots; a feature store where feature definitions live once and are computed the same way for training and serving; point-in-time joins that avoid label leakage; and monitoring of feature distributions. It answers 'what exact data produced this model, and is production consuming the same features?'
Why do you need it?
- Train/serve skew — computing a feature differently at serving than at training — quietly destroys accuracy.
- Reusing features across teams beats re-implementing them subtly differently in every notebook.
- Versioned datasets make retraining, backtesting and audits exact and replayable.
- Feature drift is the earliest warning that a model will degrade.
Mental model
A company's master product catalogue
A feature store
One canonical catalogue feeds every storefront and warehouse; nobody pencils in prices from memory. A feature store is the same idea for model inputs: one canonical definition, computed and versioned once, consumed by every model — so retail price (feature) never differs between the shop window (serving) and the stock sheet (training).
How it works
- Dataset versioning: snapshot raw data with a hash; training runs declare immutable dataset IDs.
- Feature definitions: one versioned compute unit per feature, shared by training and serving paths.
- Point-in-time correctness: joins use the value as of the prediction moment, avoiding future 'leakage'.
- Online vs offline stores: batch-computed offline features for training; low-latency online store for requests.
- Monitoring: track per-feature distributions and missing rates across train and serve.
One feature definition feeding training and serving.
In production
- A recommendation team versioned a 2-year click dataset; every model run names the dataset ID, making A/B debug and re-invocations exact.
- A payments company serves the same fraud features through an online store at <2ms and trains on the offline store — skew dropped to near zero.
- An anomaly team monitors feature distributions weekly and pages on a drift ratio, catching data pipeline breakage before it reaches models.
Best practices
- Make every feature a definition (code), not a spreadsheet of values; version the definition.
- Share the feature compute between training and serving; never hand-roll a second implementation.
- Use point-in-time joins for any feature that changes over time — prevent leakage by design.
- Monitor feature stats in training and in production continuously from day one.
- Keep raw data immutable and reproducible; transforms always consume versioned snapshots.
Common mistakes
- Recomputing a 'feature' differently in the serving request path (missing lag, different rounding).
- Leaking the future: joining labels or features after the prediction timestamp.
- Storing feature code only in notebooks — unversioned and divergent.
- Ignoring missing-rate and distribution drift until models silently degrade.
Common issues
Serving scores differ from training-time scores on the same entityFeature computation differs between train and serve (timing, rounding, encoder)
Use one shared feature definition and log both path outputs on an overlap sample.
Model overfits on validation but not on live trafficPoint-in-time violation: features use the future relative to the label
Rebuild joins strictly 'as of' prediction time; validate on a temporal split.
Feature missing rate spikes in productionUpstream pipeline stopped populating the online store for some entities
Monitor missing/zeroth/NaN rate per feature and alert on the spike; degrade handling.
Debugging tips
- Score a sample through the training path and the serving path; any divergence localizes skew.
- Check the timestamp used in joins — 'as of' bugs cause the classic % of leakages combined.
- If a model 'suddenly' underperforms, look at feature missing rates and distributions first.
- Rehydrate an old dataset snapshot to reproduce an incident exactly.
Interview checkpoint
Hands-on lab
- Create an immutable dataset snapshot with a content hash
- Build a 'wrong' join that leaks future information and a 'correct' point-in-time join
- Prove how leakage inflates offline accuracy
Version a Dataset and Detect a Leaky Join
30 min · intermediate
Quick quiz
Which symptom most directly indicates train/serve skew?
Storing features as manually-maintained spreadsheets is a scalable MLOps practice.