# 042. Strength prediction by curing age

**Question:** At which curing ages are the fixed strength model errors largest?

## Result

The largest computed metric is 5.489 for (28.0, 90.0]; the smallest is 3.128 for (0.0, 7.0]. Metric: mae (MPa MAE).

Small holdout groups make age-specific averages unstable; this is a diagnostic, not a new independent test.

![Strength prediction by curing age](outputs/chart.png)

| band | test_samples | mae |
| --- | --- | --- |
| (0.0, 7.0] | 47 | 3.128 |
| (28.0, 90.0] | 27 | 5.489 |
| (7.0, 28.0] | 95 | 4.501 |
| (90.0, inf] | 25 | 4.775 |

The chart shows 4 of 4 result rows; the table previews the first 4 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

Stratify grouped-holdout residuals by prespecified curing-age bands.

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: 836; test observations: 194. Fixed configurations specified before scoring; no tuning on the holdout.

Target: `strength`. Features: cement, slag, fly_ash, water, superplasticizer, coarse_aggregate, fine_aggregate, age. Model results and row membership are recorded in [evaluation.json](outputs/evaluation.json).

## Decision and limitations

Review error patterns across testing ages when specifying an external validation study.

Laboratory observations do not certify a construction mix. Composition and curing conditions are confounded. Models require independent engineering validation and cannot replace strength testing. 

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/042-strength-prediction-by-curing-age/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

[Concrete Compressive Strength](https://archive.ics.uci.edu/dataset/165/concrete+compressive+strength), Yeh (1998). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/concrete.json) and [prepared-data audit](../../data/provenance/concrete_prepared.json) record the downloaded files, field coverage and hashes.
