Data Validation and Anomaly Detection
Data validation checks whether data follows declared rules, while anomaly detection finds unusual values or patterns relative to a baseline. Together they catch known defects and surface unexpected changes before unreliable data reaches reports, applications, or models.
itData engineering and analytics | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
Data Validation and Anomaly Detection
Data validation compares data with explicit expectations. Anomaly detection compares data with a model of expected behavior. The first answers, “Does this data obey the contract?” The second asks, “Does this data look unusual enough to investigate?”
These controls solve related but different problems. A validation rule can prove that every order has a non-null identifier. It cannot discover an unexpected drop in daily orders unless that behavior has a rule. An anomaly detector can flag the drop after learning a baseline. It cannot decide whether the drop violates a business agreement.
The central architecture has two detection layers and one response loop:
producer -> dataset -> profile -> deterministic validation -> adaptive detection
| | |
v v v
metrics pass/fail results anomaly scores
\ | /
-> evidence -> triage -> response -> feedback
Profiling measures the data. Validation applies declared constraints. Anomaly detection scores deviations from a baseline. Triage combines those signals with business context before a system warns, quarantines, rejects, or accepts the data.
Define the unit and boundary first
A check is meaningful only when its evaluation boundary is clear. Decide what is being evaluated:
- a field, such as an email address or transaction amount;
- a row, such as an order whose end time must follow its start time;
- a table, such as a daily partition that must contain at least one row;
- a relationship, such as every order customer referring to a known customer;
- a batch or time window, such as today's null rate compared with recent days;
- two datasets, such as source and target totals after a migration.
Also record the population and time window. A null rate for a full table is not interchangeable with a null rate for the latest partition. A detector trained on weekdays may treat normal weekend volume as anomalous.
Validation turns expectations into executable rules
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.gov.uk/government/publications/the-government-data-quality-framework/the-government-data-quality-framework
Supports
- Fitness for purpose and the distinctions among completeness, uniqueness, consistency, timeliness, validity, and accuracy
- Validity does not prove accuracy, and quality dimensions can trade off
- Data quality rules and communication throughout the data lifecycle
- https://docs.greatexpectations.io/docs/core/introduction/try_gx/
Supports
- Expectations explicitly define states to which data should conform
- Expectation Suites collect expectations and Validation Definitions connect suites to batches
- Validation Results include metrics for failed expectations
- https://docs.getdbt.com/docs/build/data-tests
Supports
- Data tests are assertions about project resources
- Built-in checks cover non-null, unique, accepted-value, and relationship conditions
- Query-based tests return failing rows
- https://pandera.readthedocs.io/en/stable/
Supports
- Pandera provides schemas and checks for dataframe-like objects
- Validation can be embedded in Python data-processing code
- https://www.tensorflow.org/tfx/data_validation/get_started
Supports
- Profiles and inferred schemas require domain review
- Validation can compare dataset statistics with a schema or inspect examples
- TFDV supports training-serving skew and cross-period drift comparisons
- https://www.tensorflow.org/tfx/data_validation/anomalies
Supports
- Distribution comparisons can use divergence thresholds
- Drift and skew depend on chosen reference and treatment statistics
- https://scikit-learn.org/stable/modules/outlier_detection.html
Supports
- Distinction between outlier detection and novelty detection
- Score thresholds convert detector outputs into inlier and outlier labels
- Isolation Forest, Local Outlier Factor, One-Class SVM, and covariance methods have different assumptions and interfaces
- High-dimensional or assumption-light outlier detection is challenging
- https://asq.org/quality-resources/control-chart
Supports
- Control charts use time-ordered data, a center line, and control limits
- Control limits distinguish stable process variation from special-cause signals
- https://asq.org/quality-resources/articles/the-100th-anniversary-of-the-control-chart
Supports
- Shewhart's May 1924 memorandum contained the control-chart diagram
- https://doi.org/10.1214/aoms/1177729885
Supports
- Frank Grubbs published Sample Criteria for Testing Outlying Observations in March 1950
- https://books.google.com/books/about/Exploratory_Data_Analysis.html?id=ggWJ0AEACAAJ
Supports
- John Tukey's Exploratory Data Analysis was published in 1977
- Exploratory summaries and visual methods became a formal statistical practice
- https://proceedings.neurips.cc/paper/1999/hash/8725fb777f25776ffa9076e44fcfd776-Abstract.html
Supports
- The 1999 method estimated a boundary around an unlabeled reference distribution for novelty detection
- https://dl.acm.org/doi/10.1145/335191.335388
Supports
- Local Outlier Factor was published in 2000
- LOF compares local density with neighboring observations
- https://doi.org/10.1109/ICDM.2008.17
Supports
- Isolation Forest was presented at ICDM in December 2008
- The method isolates anomalies with randomized feature splits instead of first profiling normal observations
- https://deem.berlin/publication/automating-large-scale-data-quality-verification-vldb/
Supports
- Declarative constraints can be translated into aggregate queries for production-scale verification
- The published system supported incremental validation and anomaly detection over quality metrics
- https://blog.tensorflow.org/2018/09/introducing-tensorflow-data-validation.html
Supports
- TFDV was publicly introduced in September 2018
- Continuous arriving-data validation and training-serving skew were stated production use cases
- https://www.amazon.science/publications/deequ-data-quality-validation-for-machine-learning-pipelines
Supports
- Deequ was published in 2018 as an open-source Spark library
- Deequ makes assumptions explicit and validates them automatically over large datasets
- https://docs.soda.io/soda/product-overview.html
Supports
- Soda scans datasets with explicit checks and reports pass, warn, fail, or error states
- SodaCL covers missing values, duplicates, schema changes, freshness, and custom checks
- Failed checks produce evidence for investigation
- https://docs.soda.io/data-observability
Supports
- Metric monitors learn from historical measurements and flag unexpected behavior
- Adaptive monitoring and explicit testing serve different operational purposes
- Seasonality, false positives, and investigation affect anomaly operations
- https://docs.soda.io/data-observability/metric-monitoring-dashboard
Supports
- Metric monitors establish baselines and compare new measurements with expected patterns
- Sensitivity, exclusions, and threshold strategy affect alerts
- https://docs.elementary-data.com/data-tests/how-anomaly-detection-works
Supports
- Elementary compares recent metric values such as row count and null rate with historical values
- Historical windows and seasonality inform anomaly thresholds
- https://dqops.com/docs/categories-of-data-quality-checks/how-to-detect-anomaly-data-quality-issues/
Supports
- Monitoring checks and partition checks observe different populations
- Partition-level metrics can expose recent anomalies hidden by full-table history
- Stored time-series metrics support anomaly detection
- https://docs.datakitchen.io/testgen/data-quality-testing/
Supports
- Profiling results can generate test thresholds and test definitions
- Test runs distinguish passed, warning, failed, error, and log states
- Scheduled checks preserve an ongoing quality record
- https://docs.profiling.ydata.ai/latest/
Supports
- Profiling reports summarize dataset structure, distributions, missingness, and types
- Comparison reports support investigation of changes between datasets
- https://github.com/sindresorhus/awesome
Supports
- The canonical Awesome index includes the Awesome Data Engineering list
- https://github.com/igorbarinov/awesome-data-engineering
Supports
- The curated testing section includes DQOps and DataKitchen
- The profiling section includes YData Profiling
- https://greatexpectations.io/
Supports
- Great Expectations offers an open-source validation framework and managed product options
- https://www.soda.io/
Supports
- Soda combines open tooling with managed data quality and observability capabilities
- https://www.elementary-data.com/
Supports
- Elementary combines dbt-oriented testing, monitoring, and anomaly detection
- https://datakitchen.io/products/testgen/
Supports
- TestGen profiles tables, generates validation tests, and monitors data quality metrics
- https://www.montecarlodata.com/platform/data-quality/
Supports
- Monte Carlo monitors freshness, volume, schema, and other data quality signals
- Managed coverage routes detected issues into investigation workflows
- https://docs.bigeye.com/docs/what-is-bigeye
Supports
- Bigeye combines anomaly detection, data quality rules, lineage, reconciliation, and incident management
- https://docs.bigeye.com/docs/metrics
Supports
- Bigeye tracks table and column metrics as time series and alerts on out-of-bounds behavior
