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
Don't Panic
Don't Panic — Data Validation and Anomaly Detection
Data validation is the part of a data system that asks whether the data obeys the rules somebody meant to write down. An order identifier must be present. A customer identifier must resolve. A status must belong to the allowed set. This is not glamorous, but neither is discovering that a cheerful dashboard has been counting the same order twice. The dashboard will remain cheerful. That is how it gets you.
Anomaly detection asks a different question: does this batch look odd compared with its baseline, the recorded picture of normal behavior? A daily order count can fall sharply while every remaining row still passes its validation rules. The unusual count is a reason to investigate, not a court verdict. A holiday, release, source outage, or genuine business change can all make a number behave suspiciously without making it wrong.
The useful mental model has three pieces. Profile data to see row counts, null fractions, category frequencies, and similar evidence. Turn known requirements into rules. Then compare changing behavior with a baseline that has the right window and segment. A whole-table metric can conceal a failed partition, and a weekday baseline will become melodramatic about a normal weekend. Statistics, like office plants, require some knowledge of their surroundings.
The surprising bit is that a green result is not necessarily good news. Validation only catches expectations that were encoded. Anomaly detection only finds behavior that looks rare against its chosen history. A common but wrong value can pass both, while a legitimate new category can alarm the detector. That is why a result needs evidence, a response, and a record of the dataset, window, rule or model version, and threshold.
Read the Intro for the full control path and the limits of each method. Use the Slides when the vocabulary has multiplied like a spreadsheet with ideas above its station. Keep the Cheatsheet nearby for rule families, baselines, thresholds, and triage. The practice material turns the distinctions into failing-row queries and a partition gate. The quiz then checks whether the control you chose actually matches the failure you meant to catch.
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
- https://docs.getdbt.com/docs/build/data-tests
Supports
- Data tests are SQL assertions that return failing records
- A singular data test passes when its query returns zero failing rows
- Generic and singular tests support reusable and one-off data assertions
- https://www.metaplane.dev/blog/data-quality-issue-management-process
Supports
- Data quality triage requires confirming the issue, assessing downstream impact, and tracing root cause
- Containment decisions depend on how affected data will be used
- Recovery includes testing after the fix and tracking time to detect and resolve incidents
