# 074. Later-model fuel economy transfer

**Question:** How do specification-based models perform on later model years?

## Result

The largest computed metric is 11.95 for Median baseline; the smallest is 3.798 for Extra trees. Metric: mae (MPG MAE).

The split is by ordered records and may split the boundary year; it does not imply exact release-date chronology.

![Later-model fuel economy transfer](outputs/chart.png)

| model | mae | rmse | r2 | bias |
| --- | --- | --- | --- | --- |
| Median baseline | 11.95 | 13.31 | -3.94 | -11.89 |
| Ridge | 4.174 | 5.52 | 0.1501 | -2.948 |
| Extra trees | 3.798 | 5.178 | 0.2523 | -2.775 |

The chart shows 3 of 3 result rows; the table previews the first 3 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

Chronological-by-model-year evaluation; fixed baseline and regression models.

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.

## Evaluation

First 80% of ordered observations train; final 20% test. Training observations: 318; test observations: 80. Fixed configurations specified before scoring; no tuning on the holdout.

Target: `mpg`. Features: cylinders, displacement, horsepower, weight, acceleration, model_year, origin. Model results and row membership are recorded in [evaluation.json](outputs/evaluation.json).

## Decision and limitations

Compare temporal transfer with random grouped evaluation to understand extrapolation limits.

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/074-later-model-fuel-economy-transfer/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.
