Separate row failures from reasons
A new preview batch loads successfully, but one image has zero width, another has a contrast value above its declared maximum, and two records share an ID. Training can still finish if the loader coerces those values into arrays. A successful computation says little about whether its input meant what the model assumed.
The acceptance decision belongs before publication of the training snapshot. This note builds a small explicit validator and then identifies the accepted data by content. All records, counts and hash examples below are newly authored fictional fixtures; they contain no uploaded images or external dataset.
A file that opens is not yet an accepted dataset
A parser answers whether it can read bytes. A schema answers whether the resulting fields have permitted structure. Semantic checks ask whether values mean what the task expects. Statistical checks ask whether a population changed. These observations require different follow-up actions.
For a preview, width=0 violates a declared image-size contract even if it is a valid integer. A new scanner producing lower contrast may produce perfectly valid records while changing the evaluation population. Silently clipping every out-of-range value can hide a broken unit conversion, while rejecting every distribution shift can prevent the product from accepting legitimate new users.
Give the data owner a specific failure report and preserve the permitted failing input. Do not require a model developer to reverse-engineer an unexplained training-score change to discover that a column changed units.
Classify the failure by its consequence
Our schema requires a nonempty string ID, finite numeric contrast in , a positive integer width and a format in png or jpg. IDs must be unique within this batch. Missing contrast is rejected; no imputation is implied. The following eight records define the exercise.
| Row | ID | Contrast | Width | Format | Contract failure |
|---|---|---|---|---|---|
| 0 | c01 | 0.8 | 640 | png | None |
| 1 | c02 | 0.7 | 640 | jpg | None |
| 2 | c03 | 0.25 | 480 | png | None |
| 3 | c04 | missing | 640 | jpg | Missing contrast |
| 4 | c05 | 0.6 | 0 | png | Invalid width |
| 5 | c06 | 1.1 | 640 | png | Invalid contrast |
| 6 | c07 | 0.9 | 640 | gif | Unsupported format and duplicate ID |
| 7 | c07 | 0.4 | 640 | jpg | Duplicate ID |
Five rows fail and three have no listed failure. There are six failure reasons because row 6 violates two rules. A dashboard counting reasons is therefore not a dashboard counting rejected rows. Both rows with c07 are rejected: selecting the first or last would impose an update policy that the schema never authorized.
Some checks need the full batch. An individual record cannot establish uniqueness or a join's completeness. Conversely, a mean width can look sensible while a particular record has width zero. Combine record-level checks with batch relationships, and keep their denominators explicit.
A missing field needs a declared response. If imputation is appropriate, its fitted parameters, missingness indicator and permitted populations become part of the feature contract. In this exercise we reject instead so the expected result can be determined exactly. Neither policy is universally correct.