# 075. Horsepower missingness audit

**Question:** Which model-year and origin groups contain missing horsepower measurements?

## Result

The largest computed metric is 0.25 for 81 / origin 2; the smallest is 0 for 70 / origin 2. Metric: missing_share (Missing share).

The question-mark marker has been converted to NaN. Zero missingness in a subgroup does not prove representative sampling.

![Horsepower missingness audit](outputs/chart.png)

| model_year | origin | vehicles | missing | missing_share | group |
| --- | --- | --- | --- | --- | --- |
| 81 | 2 | 4 | 1 | 0.25 | 81 / origin 2 |
| 80 | 1 | 7 | 1 | 0.1429 | 80 / origin 1 |
| 80 | 2 | 9 | 1 | 0.1111 | 80 / origin 2 |
| 74 | 1 | 15 | 1 | 0.06667 | 74 / origin 1 |
| 71 | 1 | 20 | 1 | 0.05 | 71 / origin 1 |
| 82 | 1 | 20 | 1 | 0.05 | 82 / origin 1 |
| 70 | 2 | 5 | 0 | 0 | 70 / origin 2 |
| 72 | 1 | 18 | 0 | 0 | 72 / origin 1 |
| 71 | 3 | 4 | 0 | 0 | 71 / origin 3 |
| 71 | 2 | 4 | 0 | 0 | 71 / origin 2 |
| 70 | 3 | 2 | 0 | 0 | 70 / origin 3 |
| 70 | 1 | 22 | 0 | 0 | 70 / origin 1 |
| 72 | 2 | 5 | 0 | 0 | 72 / origin 2 |
| 73 | 1 | 29 | 0 | 0 | 73 / origin 1 |

The chart shows 14 of 39 result rows; the table previews the first 14 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

Explicit missing indicators summarized over recorded groups.

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

Review source availability before interpreting imputed horsepower or dropping vehicles.

Historical city-cycle vehicle observations are not current fleet performance. Vehicle mix and model year are confounded. A '?' horsepower value means missing, not zero. 

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/075-horsepower-missingness-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

[Auto MPG](https://archive.ics.uci.edu/dataset/9/auto+mpg), Quinlan (1993). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/auto.json) and [prepared-data audit](../../data/provenance/auto_prepared.json) record the downloaded files, field coverage and hashes.
