# 098. Non-destructive measurement tradeoff

**Question:** How does restricting predictors to external measurements change ring-count error?

## Result

The largest computed metric is 2.35 for External / Median baseline; the smallest is 1.55 for Full / Extra trees. Metric: mae (Ring-count MAE).

External measurements are chosen by measurement availability; field robustness is not established.

![Non-destructive measurement tradeoff](outputs/chart.png)

| model | mae | rmse | r2 | bias | measurements | variant |
| --- | --- | --- | --- | --- | --- | --- |
| Median baseline | 2.35 | 3.424 | -0.09594 | -1.013 | External | External / Median baseline |
| Ridge | 1.834 | 2.677 | 0.3302 | -0.08277 | External | External / Ridge |
| Extra trees | 1.808 | 2.629 | 0.3538 | -0.04554 | External | External / Extra trees |
| Median baseline | 2.35 | 3.424 | -0.09594 | -1.013 | Full | Full / Median baseline |
| Ridge | 1.634 | 2.316 | 0.4985 | -0.008641 | Full | Full / Ridge |
| Extra trees | 1.55 | 2.247 | 0.5283 | -0.04281 | Full | Full / Extra trees |

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

Paired ablation of external-only versus full measurements with common input-group splits.

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

Fixed 80/20 split of unique input groups (seed 42); exact input duplicates stay together. Training observations: 3,341; test observations: 836. Fixed configurations specified before scoring; no tuning on the holdout.

Target: `rings`. Features: sex, length, diameter, height, whole_weight, shucked_weight, viscera_weight, shell_weight. Model results and row membership are recorded in [evaluation.json](outputs/evaluation.json).

## Decision and limitations

Compare measurement effort and external accuracy before proposing a field workflow.

Physical measurements use source scaling. Rings are the modeled target; the source describes an approximate age conversion. Site and animal group identifiers are unavailable, limiting biological generalization. 

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/098-non-destructive-measurement-tradeoff/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

[Abalone](https://archive.ics.uci.edu/dataset/1/abalone), Nash et al. (1994). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/abalone.json) and [prepared-data audit](../../data/provenance/abalone_prepared.json) record the downloaded files, field coverage and hashes.
