Skip to content

feat(predict): two narrow prediction spaces fixed before a run - #27

Merged
chrisfoulon merged 3 commits into
mainfrom
feat/narrow-prediction-spaces
Sep 17, 2026
Merged

chrisfoulon merged 3 commits into
mainfrom
feat/narrow-prediction-spaces

Conversation

@chrisfoulon

@chrisfoulon chrisfoulon commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Three things, all ahead of the BBS run.

1. Two narrow prediction spaces, fixed before the run. optim_dict_raw_kernel (Gaussian kernel, sigma only) and optim_dict_raw_elastic (ElasticNet), both on raw morphospace coordinates. The design audit (§9–10) found that with the full space no target kept the same model+features across its five folds, and that picking the space by inner CV did no better. So the space is fixed in advance, both arms are reported, and neither is chosen afterwards. Checked end to end on swiss_roll: every fold of each run holds only the raw coordinates and the intended estimator. Config-only addition; no existing code path changes.

2. The 0.5 mm grid offset is fixed at source (B11, B6). The disconnectome tool built its 2 mm maps by pooling 2×2×2 blocks of the 1 mm grid, so coarse voxel centres fell between standard 2 mm centres — same template throughout, not a template mismatch. Fixed in that tool and the maps regenerated onto the reference grid, which also corrects the resolution tag in the filenames. r = 0.986 against the old maps shifted onto the new grid, versus 0.960 comparing them as-is, so the offset was the whole difference. The trilinear fallback is not needed.

3. Prediction pinning split from the claim CI can check. test_prediction_scores compares per-target scores against baselines recorded on one CPU but was not marked machine_specific, so CI ran it and went red on a runner with a different llvm_cpu_name — 0.9914 against a baseline of 0.9936, on a commit that added two unused config dicts. It is now machine_specific, and a new test_prediction_stays_in_its_regime carries the part that holds on any CPU: predictions must still read the embedding coordinates, and a clearly predictive target must stay above a coarse floor far below its baseline. PREDICTION_RTOL is untouched; this is a separate guard, not a loosened copy. Both branches perturbed and seen to fail.

Docs: plan B9 (200 serial UMAP trials; profiling shows the UMAP distance step is the whole cost; the precomputed-distance shortcut considered and dropped), B11/B6 ticked, B12 (150 trials per arm), B5 narrowed to the remaining run-log check; STATUS updated.

Local --core green on the baseline machine (17/17 suites, regression 29 → 32 tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DrLKJZx7PmzAsZJCUiYm5g

chrisfoulon and others added 3 commits September 16, 2026 23:40
optim_dict_raw_kernel (Gaussian kernel, sigma 0.02-0.3 log) and
optim_dict_raw_elastic (ElasticNet), both on raw morphospace coordinates only.
The DSD audit (§9-10) found the full space picked different model+features in
every fold and could not be rescued by choosing the space from inner CV, so the
space is fixed in advance and both arms are reported, neither picked afterwards.

Checked end to end on swiss_roll: all 5 folds of each run hold only the raw
coordinates and the intended estimator.

Plan: records the 200-trial serial morphospace search (profiled: the UMAP
pairwise-distance step is the whole cost, HDBSCAN is negligible), why the
precomputed-distance shortcut was dropped, the cause of the 0.5 mm grid offset,
and the prediction decision (150 trials per arm).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DrLKJZx7PmzAsZJCUiYm5g
The disconnectome tool built its 2 mm maps by pooling 2x2x2 blocks of the 1 mm
grid, so coarse voxel centres fell between standard 2 mm centres. Fixed in that
tool and the maps regenerated: every map is now on the reference grid, and the
resolution tag in the filenames is right, which also closes B6.

Checks on the new maps: r = 0.986 against the old maps shifted onto the new
grid, versus 0.960 comparing them as-is, so the offset was the whole difference.
Same lesion-load distribution, no NaNs. The trilinear fallback is not needed.

B5 narrows to what is left: the run itself has to keep every labelled file and
log neither "multiple valid ID matches" nor "different cohort". The labels CSV
and file list are built and their per-target counts asserted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DrLKJZx7PmzAsZJCUiYm5g
`test_prediction_scores` compares per-target scores against baselines recorded
on one CPU, but was not marked `machine_specific`, so CI ran it. Those are the
scores of whichever Optuna trial won, which is the quantity this file already
documents as not portable: on 2026-09-17 a runner reporting llvm_cpu_name
`emeraldrapids` rather than the baseline machine's `meteorlake` gave swiss_roll
target_0_Min_Score 0.9914 against a baseline of 0.9936, on a commit that added
two unused config dicts. Full `--core` was green on the baseline machine for
that same commit, and a re-run of the identical code on another runner passed.

Marking it `machine_specific` alone would leave CI with nothing to say about
prediction, so the claim CI *can* check is now its own test:

  * where the baseline's predictions read the embedding coordinates, they must
    still read them (a boolean, not the fold count, whose flips are the
    CPU-dependent argmax); and
  * where a target is clearly predictive, it stays above a coarse floor of 0.5,
    which sits nowhere near swiss_roll's 0.996 and so cannot be reached by drift.

Not a loosened copy: PREDICTION_RTOL is untouched and the pinned comparison
still gates on this machine. Both branches perturbed and seen to fail (forcing
the boolean false; scaling the mean scores by 0.1), and the CI selection checked
-- `-m "not machine_specific"` now picks up the regime test and drops the pinned
one. Local `--core` green, regression suite 29 -> 32.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DrLKJZx7PmzAsZJCUiYm5g
@chrisfoulon
chrisfoulon merged commit 32e3691 into main Sep 17, 2026
1 check passed
@chrisfoulon
chrisfoulon deleted the feat/narrow-prediction-spaces branch September 17, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant