# 034. Repeated laboratory signature audit

**Question:** How often do identical laboratory signatures recur, and can their sensory scores disagree?

## Result

The largest computed metric is 4,328 for Single record; the smallest is 2,169 for Repeated with same score. Metric: source_rows (Source rows).

No batch identifiers are supplied; identical inputs need not be duplicate ingestion errors.

![Repeated laboratory signature audit](outputs/chart.png)

| signature_class | signatures | source_rows |
| --- | --- | --- |
| Repeated with same score | 992 | 2169 |
| Single record | 4328 | 4328 |

The chart shows 2 of 2 result rows; the table previews the first 2 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Group exact predictor signatures and count score multiplicity without treating repeated rows as proven errors.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Preserve input groups in evaluation and investigate the meaning of repeats before deduplicating.

Sensory scores are ordinal and concentrated in the middle. Producer and batch IDs are unavailable. Associations are not recipes for changing quality or evidence of market price. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/034-repeated-laboratory-signature-audit/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Wine Quality](https://archive.ics.uci.edu/dataset/186/wine+quality), Cortez et al. (2009). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/wine.json) and [prepared-data audit](../../data/provenance/wine_prepared.json) record the downloaded files, field coverage and hashes.
