Home / Insights / AI and Machine Learning
AI and Machine Learning
Data Quality for AI: Profiling, Data Contracts and Monitoring Before Model Work Begins
Most machine learning projects that disappoint do not fail at the modelling stage. They fail because the data was incomplete, inconsistent or quietly changed. This guide sets out a practical sequence of profiling, data contracts and monitoring to put in place before model work starts.
Key takeaways
- Profile the actual source data before committing to a model, a timeline or an accuracy target. Profiling turns assumptions about completeness, duplicates, label quality and history into measured facts.
- A data contract is an agreement between the team that produces data and the teams that consume it, covering schema, quality rules, freshness, ownership and change notice. It prevents the silent upstream changes that break models.
- Automate validation at pipeline boundaries: schema and range checks on ingestion, and distribution checks for training-serving skew and drift once a model is live.
- Data quality work is not overhead to minimise. It sets the ceiling on what any model can achieve and is usually where the largest share of AI project effort and risk sits.
- Start small: profile one use case’s data, write contracts for the few tables it depends on, and add monitoring before go-live rather than trying to fix all enterprise data first.
On this page
- Why data quality comes before model work
- How to profile data before committing to a model
- What data contracts are and why they matter
- How to monitor data once models are live
- How to put this in place step by step
- Costs, risks and common mistakes
- Readiness checklist before model work
- Frequently asked questions
- Sources and methodology
A common pattern in AI projects goes like this. A team agrees a use case, picks a model approach, sets a timeline, and only then opens the data. They find missing values in key fields, duplicate customers, labels that mean different things in different years, and a source system that changed its codes last spring. The timeline slips, the accuracy target looks unrealistic, and confidence in the project drops.
This article is for CTOs, data leads and product owners planning machine learning or AI features on their own operational data. It explains how to profile data before model work, how to agree data contracts with the teams that own source systems, how to monitor data once a model is in production, and what this costs. It reflects how we approach AI and data projects, where data access, acceptance criteria and evaluation sets are settled before building, and data preparation is treated as a major cost factor rather than a footnote.
Why data quality comes before model work
Google’s Machine Learning Crash Course puts it plainly: a model is only as good as the data it trains on. It lists the problems that most often undermine datasets: omitted values, duplicate examples, bad feature values from typos or faulty sensors, bad labels, and whole sections of data that are unreliable because of an outage or process failure.
These are not exotic issues. They appear in almost every operational database, because those systems were built to run a business process, not to train models. A field that is optional in a form will be blank much of the time. A status code that was repurposed three years ago will mean two different things in your history. A manual override process may leave no trace in the data at all.
What poor data does to an AI project
- Inflated expectations: early prototypes trained on a clean sample perform well, then degrade on real data.
- Hidden bias: missing or skewed records for certain customer groups, regions or periods lead to uneven model performance.
- Fragile production systems: an upstream schema or code change breaks features without any error being raised.
- Wasted modelling effort: teams tune algorithms to compensate for problems that should be fixed at the source.
Governance frameworks reflect this. The NIST AI Risk Management Framework, released in January 2023, treats understanding of data and its limitations as part of managing AI risk across the lifecycle, not as a one-off step before training.
Action
Do not set accuracy targets or delivery dates for a model until the data it depends on has been profiled. Our article on baselines and success metrics for machine learning projects explains how to set those targets once the data picture is clear.
How to profile data before committing to a model
Profiling is a structured look at the data a use case will depend on. It answers whether the data can support the intended model and what work is needed first.
What to measure
| Dimension | Questions to answer | Typical checks |
|---|---|---|
| Completeness | Are key fields populated, and for which periods and segments? | Missing value rates by field, by month and by segment |
| Uniqueness | Do records represent distinct real-world entities? | Duplicate keys, near-duplicate customers or products |
| Validity | Do values fall in expected ranges and formats? | Range, format and reference data checks |
| Consistency | Do related fields and systems agree? | Cross-field rules, reconciliation between systems |
| Timeliness | Is data fresh enough for the decision being automated? | Lag between event and availability |
| Label quality | Is the outcome you want to predict recorded reliably? | Sample review by domain experts, label definition changes over time |
| History and stability | Has the meaning of fields changed? | Distribution shifts at known system or process changes |
A step-by-step profiling sprint
- Map the data the use case needs. List each entity, field and source system, and who owns it.
- Extract representative history. Include enough time to capture seasonality and at least one known process change.
- Run automated profiling. Compute statistics per field: missing rates, distinct values, ranges and distributions. Tools such as TensorFlow Data Validation, described in the TFX documentation, compute descriptive statistics and infer an initial schema that a team then reviews and edits.
- Review labels with domain experts. Sample records and confirm that the outcome field means what the team thinks it means.
- Look for suspicious patterns. The TFDV guide highlights examples such as features that are almost constant, uniform distributions that often indicate a bug, and labels accidentally included as features.
- Write a short findings report. State what is usable, what needs fixing, what is missing and the impact on the use case.
For example, an illustrative 200-person distributor planning demand forecasting might find that two years of order history are usable, but that returns were recorded in a separate system until last year and promotional periods were never flagged. That changes the scope: the first deliverable becomes a cleaned, joined dataset with a promotion flag, not a forecasting model.
What data contracts are and why they matter
Profiling tells you the state of the data today. Data contracts protect you from tomorrow’s changes.
The problem they solve
Source systems change for good business reasons: a new product category, a revised status code, a field renamed during an upgrade. The team making the change rarely knows a model depends on that field. Without a contract, the model keeps running and its outputs quietly degrade.
What a contract contains
A data contract is a written, versioned agreement between a data producer and its consumers. The Open Data Contract Standard maintained by the Bitol project defines a platform-agnostic YAML format whose sections include schema, data quality rules, team roles and ownership, support channels and service-level agreements. In practice, a useful contract for AI work covers:
- Schema: fields, types, allowed values and keys.
- Semantics: plain-language definitions, especially for status codes and outcome fields.
- Quality rules: completeness thresholds, uniqueness, valid ranges and reconciliation checks.
- Freshness: how quickly data is available after the business event.
- Ownership: who is accountable for the data and who to contact when checks fail.
- Change process: how much notice consumers get before breaking changes, and how versions are handled.
How to introduce them without bureaucracy
Start with the handful of tables your first use case depends on. Write the contract with the source system owner, keep it in version control next to the pipeline code, and turn the quality rules into automated checks. A contract that is not enforced by tests becomes outdated documentation within months.
| Approach | Strengths | Weaknesses | When it fits |
|---|---|---|---|
| No formal agreement, ad hoc fixes | No upfront effort | Silent breakages, repeated firefighting | Short experiments only |
| Documented data dictionary | Shared definitions | Not enforced; drifts from reality | Early-stage analytics |
| Data contracts with automated checks | Enforced expectations, clear ownership, change notice | Needs producer engagement and pipeline work | Any model that runs in production |
| Enterprise data governance programme | Broad consistency | Slow, expensive, may not prioritise your use case | Large organisations with many consumers |
How to monitor data once models are live
Validation does not stop at training. Data feeding a live model changes, and those changes are often the first sign that performance will drop.
Three kinds of checks
- Schema and rule checks on every batch or stream: types, required fields, ranges and contract rules. Failures should block or quarantine data, not just log a warning.
- Training-serving skew: the TFX documentation describes skew as a significant difference between the distribution of feature values in training data and in the data the model sees in production, often caused by different data sources or sampling.
- Drift over time: comparing consecutive periods of data. TFDV, for example, uses L-infinity distance for categorical features and an approximate Jensen-Shannon divergence for numeric features, with thresholds set by the team through iteration and domain knowledge.
Deciding thresholds and responses
Not every alert needs the same response. Agree in advance what happens when each check fails:
| Signal | Example | Response (illustrative) |
|---|---|---|
| Contract rule failure on a critical field | Customer ID missing in a batch | Quarantine batch, alert producer, hold predictions |
| Skew between training and serving | A feature computed differently in production | Investigate pipeline, fix before trusting outputs |
| Gradual drift | Product mix shifting over months | Review model performance, schedule retraining if needed |
| Sudden drift | New status codes after a system upgrade | Check contract change log, update mappings, assess impact |
Monitoring data inputs complements monitoring model outputs and business outcomes. Our article on MLOps for small teams covers versioning, model monitoring and retraining in more detail.
How to put this in place step by step
You do not need an enterprise data platform to do this well. A focused sequence tied to one use case works better.
- Choose one use case with a clear decision to improve and an owner who cares about the outcome.
- Run a profiling sprint on its data and publish the findings, including what cannot be done yet.
- Fix the highest-impact issues at the source where possible, such as making a key field mandatory or recording a missing event, rather than compensating in the model.
- Write data contracts for the tables and feeds the use case depends on, with the source owners.
- Automate validation in the pipeline: contract rules on ingestion, schema checks before training, and skew and drift checks in production.
- Build an evaluation set from verified data so model changes can be compared reliably.
- Only then start model development, with targets informed by what the data can support.
- Review quarterly: contract changes, alert history and whether new use cases can reuse the same data.
Where real data is scarce or too sensitive to use directly, synthetic data can help with testing, though it inherits the limits of the data it is generated from; see our article on synthetic data for AI training and testing. For image and text labelling, quality control of labels deserves the same rigour as structured data.
Costs, risks and common mistakes
Where the cost goes
- Profiling and investigation: mostly analyst and engineer time, plus domain expert time for label review.
- Source fixes: changes to operational systems or processes, which may need their own approvals.
- Pipeline engineering: validation checks, quarantine handling and alerting.
- Ongoing ownership: producers maintaining contracts and responding to failures.
These costs are front-loaded, but they reduce later costs: fewer failed experiments, fewer production incidents and faster delivery of the second and third use cases on the same data.
Common mistakes
- Profiling a clean extract rather than the real feed, which hides the problems production will expose.
- Treating labels as ground truth without checking how they were recorded.
- Writing contracts nobody enforces, so they drift from reality.
- Alerting without agreed responses, which leads teams to ignore alerts.
- Trying to fix all enterprise data first, delaying value indefinitely.
Privacy and access
Profiling often touches personal data. Use the minimum data needed, profile in controlled environments, and agree access rules with data owners and privacy teams before extracting history.
Readiness checklist before model work
- The use case, decision and owner are defined.
- Every source table and field the use case needs is mapped, with an owner.
- Representative history has been profiled for completeness, uniqueness, validity, consistency and timeliness.
- Labels have been reviewed by domain experts and their definitions confirmed over time.
- Known process and system changes are documented and visible in the data.
- Highest-impact data issues have a fix plan, at source where possible.
- Data contracts exist for critical tables, in version control, with automated checks.
- Pipeline validation blocks or quarantines bad data rather than only logging it.
- Skew and drift monitoring is designed, with thresholds and agreed responses.
- An evaluation set has been built from verified data.
- Accuracy targets and timelines are based on the profiling findings.
If several of these are missing, the most valuable next step is usually a short profiling sprint on one use case. It costs far less than a stalled model build and gives everyone a realistic picture of what AI can deliver on your data.
Frequently asked questions
How long does data profiling take before an AI project?
For a single, well-scoped use case it is usually a short piece of work measured in weeks rather than months, depending on data access and the number of source systems. The main delays come from getting access approvals and domain expert time for label review.
Do we need a data platform or data catalogue before starting AI work?
No. You need reliable data for the use case in front of you. Profiling, contracts and validation can be implemented for a handful of tables in your existing environment, and extended as more use cases follow.
What is the difference between a data contract and a data dictionary?
A data dictionary documents definitions. A data contract adds enforceable expectations, such as quality rules, freshness and change notice, plus named ownership, and is backed by automated checks in the pipeline.
Who should own data quality: the data team or the source system team?
The source system team should own the data it produces and the contract describing it. The data or AI team owns validation in its pipelines and raises issues. Shared ownership without clear roles usually means nobody fixes problems.
Can large language models avoid the need for clean data?
Not for prediction and classification on your operational data. LLMs can help with tasks such as standardising free text or suggesting mappings, but outputs still depend on the quality and meaning of the underlying records, and should be validated like any other data.
Sources and methodology
Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.
- Google for Developers: Machine Learning Crash Course, data characteristics — accessed 9 November 2026. Common dataset problems (omitted values, duplicates, bad features and labels) and that a model is only as good as its training data.
- TensorFlow: TensorFlow Data Validation guide — accessed 9 November 2026. Descriptive statistics, schema inference, anomaly detection, training-serving skew and drift detection methods.
- Bitol: Open Data Contract Standard — accessed 9 November 2026. Contents of a data contract: schema, data quality, roles and ownership, support and service-level agreements.
- NIST: AI Risk Management Framework — accessed 9 November 2026. Lifecycle approach to managing AI risk, released January 2023.
Related reading
Continue your research
Is your data ready for the AI use case you are planning?
We can run a short profiling sprint on the data behind one use case and tell you what is usable, what needs fixing and what a realistic target looks like.
