# 070. Vehicle weight and fuel economy

**Question:** How does fuel economy differ across declared vehicle-weight bands?

## Result

The largest computed metric is 32.4 for (0.0, 2000.0]; the smallest is 14 for (4000.0, inf]. Metric: median_mpg (Miles per US gallon).

Engine size, model year and origin differ across weight bands.

![Vehicle weight and fuel economy](outputs/chart.png)

| weight_band | vehicles | median_mpg | p25 | p75 |
| --- | --- | --- | --- | --- |
| (0.0, 2000.0] | 44 | 32.4 | 29.95 | 36.02 |
| (2000.0, 2500.0] | 103 | 29 | 25 | 33.9 |
| (2500.0, 3000.0] | 83 | 24 | 21.3 | 27 |
| (3000.0, 3500.0] | 59 | 19.1 | 17.65 | 20.9 |
| (3500.0, 4000.0] | 45 | 17 | 15 | 18.5 |
| (4000.0, inf] | 64 | 14 | 13 | 15.12 |

The chart shows 6 of 6 result rows; the table previews the first 6 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

Robust fuel-economy summaries by weight band.

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

Use controlled vehicle comparisons before attributing fuel economy differences to weight alone.

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/070-vehicle-weight-and-fuel-economy/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.
