You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add within-group lengthscale shrinkage prior for the strength GP
In the strength GP fit on the public dataset, the Matern ARD
lengthscales for Fly Ash and Coarse Aggregates rail to the upper
cap (~1000): both features are under-sampled relative to Cement and
Fine Aggregate, so the marginal likelihood is essentially flat in
their lengthscale direction and the optimiser drifts to the constraint
boundary. This makes the strength surface look insensitive to those
two ingredients in the explorer UI, even though concrete chemistry
clearly says it isn't.
This PR introduces `WithinGroupShrinkagePrior` — a soft hard-tying
prior that ties Matern ARD lengthscales within material groups. The
production setting (`sigma=0.001`) ties members of {Cement, Fly Ash,
Slag} to a single binder lengthscale, and {Fine, Coarse} aggregates
to a single aggregate lengthscale, encoding the domain prior that
ingredients of the same material class should share kernel smoothness.
The structural prior:
* Beats the no-prior baseline on held-out LOO CV RMSE — 725 vs
772 psi on the 647 public strength rows, via the GP's closed-form
LOO identity.
* Encodes only group structure (a public, ASTM-defined fact about
cementitious vs aggregate materials), not any numeric values.
* Makes Fly Ash and Coarse Aggregate sliders responsive in the
explorer UI: both lengthscales now sit at 4.79 and 6.67
respectively, well below the cap and within the same range as
the previously-identifiable features.
Adds 11 regression tests in `test/test_lengthscale_identifiability.py`
covering identifiability against the cap, within-group tying on both
the committed and freshly-fit GP, prior installation by
`fit_strength_gp`, an LOO-CV ceiling that catches the no-prior baseline,
and unit tests for the prior class. A reproducible empirical sweep
(`scripts/lengthscale_prior_study.py`) lets users re-run the variant
comparison on their own machine. `docs/model/{strength,compositions,
test_vectors}.json` are regenerated with the new fit; the JS GP
inference and JS<->Python parity tests stay green. All LOO computation
re-uses `boxcrete.compute_loo_cv` (now also re-exported from the
package root).
See `WithinGroupShrinkagePrior` docstring in `boxcrete/models.py` for
the full empirical comparison and methodology.
0 commit comments