# 071. Engine configuration comparison

**Question:** How do cylinder groups differ in observed fuel economy and vehicle weight?

## Result

The largest computed metric is 28.25 for 4.0; the smallest is 14 for 8.0. Metric: median_mpg (Miles per US gallon).

Rare cylinder groups have few observations. Missing horsepower is not filled for descriptive medians.

![Engine configuration comparison](outputs/chart.png)

| cylinders | vehicles | median_mpg | median_weight | median_horsepower |
| --- | --- | --- | --- | --- |
| 3 | 4 | 20.25 | 2,375 | 98.5 |
| 4 | 204 | 28.25 | 2,232 | 78 |
| 5 | 3 | 25.4 | 2,950 | 77 |
| 6 | 84 | 19 | 3,202 | 100 |
| 8 | 103 | 14 | 4,140 | 150 |

The chart shows 5 of 5 result rows; the table previews the first 5 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

Cylinder-level sample sizes and median specifications.

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

Evaluate comparable vehicle configurations rather than interpreting a cylinder category as an isolated cause.

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/071-engine-configuration-comparison/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.
