# 076. Fuel consumption unit conversion

**Question:** How do MPG summaries compare with fuel used per 100 kilometres?

## Result

The largest computed metric is 16.24 for 8.0; the smallest is 8.333 for 4.0. Metric: mean_litres_per_100km (Litres per 100 km).

Uses US gallons. The nonlinear conversion of mean MPG differs from mean converted consumption; neither is fleet fuel use without distance weights.

![Fuel consumption unit conversion](outputs/chart.png)

| cylinders | vehicles | mean_mpg | mean_litres_per_100km | conversion_of_mean_mpg |
| --- | --- | --- | --- | --- |
| 3 | 4 | 20.55 | 11.58 | 11.45 |
| 4 | 204 | 29.29 | 8.333 | 8.031 |
| 5 | 3 | 27.37 | 9.103 | 8.595 |
| 6 | 84 | 19.99 | 12.11 | 11.77 |
| 8 | 103 | 14.96 | 16.24 | 15.72 |

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

Convert each observed vehicle before grouping; compare transformed observations with transforming the group average.

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 the appropriate aggregation for efficiency reports and state whether driving distance is known.

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/076-fuel-consumption-unit-conversion/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.
