Data Modeling for Machine Learning
A practical guide to emerging data architecture and AI-ready information.
State the prediction target, decision time, population, prediction horizon and unit of analysis. Align examples to the point at which a prediction would be made. This prevents features from using information unavailable at that moment.
Define the prediction task
State the prediction target, decision time, population, prediction horizon and unit of analysis. Align examples to the point at which a prediction would be made. This prevents features from using information unavailable at that moment.
Model labels and features
Define label meaning, source, observation window, outcome window, exclusions and confidence. Document feature definitions, units, missingness and update frequency. Keep transformation logic and source lineage reproducible.
Prevent leakage
Split training and evaluation data according to time, entity or deployment setting so information does not improperly cross boundaries. Fit transformations using training data only when required. Review proxy variables and post-outcome fields with domain experts.
Govern and monitor
Record data and feature versions, access, quality, representativeness and intended use. Monitor drift and label delays. Re-evaluate the data design when the population, process or decision changes; model performance depends on those assumptions.
Validate and govern
Test with representative inputs, document assumptions and limitations, and assign owners for quality, access, provenance and change. Reassess controls when sources, models, users or intended decisions change.
Frame the prediction example
Define the prediction unit, prediction time, target, eligible population and action that will use the output. A model predicting account churn needs a precise definition of churn, a label observation window and a rule for accounts that have not yet completed the window. The feature record should describe only information available at the prediction time.
Separate immutable events, current state, derived features and labels. Keep source lineage and transformation versions so training data can be rebuilt or explained. Include identifiers that support joins without leaking sensitive attributes into model inputs unnecessarily.
Prevent leakage and misleading samples
Point-in-time joins must exclude information that arrived after the prediction timestamp, even if the event is backdated. Test boundary cases around the timestamp and late ingestion. Review features that are generated by downstream decisions, because they can inadvertently encode the target or a human intervention made after the prediction point.
Document how training examples are selected, including exclusions, missing labels, censoring and class imbalance. Compare the training population with the population that will receive predictions. A high evaluation score on a convenient sample may not translate to production performance.
Govern features, labels and consumers
Assign owners to feature definitions and labels. Record units, ranges, missing-value treatment, update cadence, privacy classification and permitted uses. If different models reuse a feature, ensure they share the same meaning and availability rules. Version changes that alter calculation or source behavior.
Data access should reflect the model purpose. Limit fields to those needed, test role permissions and document derived outputs that may carry the same sensitivity as source fields. Keep human review and appeal pathways for consequential uses where applicable, guided by the organization's authorized policy owners.
Monitor the data contract after deployment
Monitor freshness, schema changes, null rates, key coverage, feature distributions and label delay. Distinguish data quality incidents from model performance changes. Assign remediation ownership across producer, feature pipeline and model consumer. Maintain a rollback or fallback option when required inputs become unreliable.
- Is the prediction unit and target definition precise?
- Are all features point-in-time valid?
- Can training rows be traced to inputs and transformations?
- Are access, purpose and retention approved?
- Are data and model signals monitored by accountable owners?
Worked example: model a churn prediction dataset
Define the prediction unit, prediction time, outcome window, and target label. Features must be available at prediction time, and label construction should not include information learned afterward. Preserve source identifiers, feature lineage, transformation versions, and cohort boundaries. Document excluded populations and known bias or missingness.
Partition evaluation data by time or entity when random splitting would leak correlated records. Compare offline and serving feature logic and monitor freshness and drift. Keep labels separate from features and apply access controls to sensitive attributes. Reproducibility requires a versioned snapshot or a deterministic path to recreate the training set.
Govern the machine-learning data lifecycle
Assign owners for features, labels, evaluation, privacy review, and retention. Test correction and deletion propagation to derived datasets. Record approval and intended use. Reassess the dataset when model purpose, population, source, or decision impact changes.
Review an ML dataset release
Check prediction unit, time cutoff, label maturity, feature availability, leakage, source lineage, population coverage, and permitted use. Reproduce a sample training row and compare offline and serving features. Document known limitations and accountable owners.
Version the dataset and evaluation snapshot. Test correction and deletion propagation. Reassess after changes in model purpose or target population.