Skip to content

SBR score plot: marker area carries the SPE, batch 4 labelled above - #91

Merged
kgdunn merged 6 commits into
mainfrom
claude/issues-154-156-process-3cu4iq
Sep 7, 2026
Merged

kgdunn merged 6 commits into
mainfrom
claude/issues-154-156-process-3cu4iq

Conversation

@kgdunn

@kgdunn kgdunn commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Follow-up to #84, on review feedback for the SBR score plot (batch/batch-case-sbr-scores.png).

What changed

  • The marker area is now the batch's SPE. The score plot showed only how extreme a batch is along the components; it now answers both questions asked of a batch in one figure. Batch 37, the furthest out along the first component, has the smallest residual of the 53 batches, and batch 34 the twelfth smallest, which is the point the influence plot beside it goes on to make with axes.
  • Batch 4's label is centred above its marker rather than to its upper right, and carries a white outline so it reads over the neighbouring markers it sits among.

How it is drawn

  • Area, not diameter, carries the value (BUBBLE is the area given to the median batch), so a marker of twice the area stands for twice the SPE.
  • Two grey circles in the legend, at SPE 20 and 35, give the scale; an area cannot be read off a plot without one.
  • A highlighted batch keeps its own area and is marked by a heavier edge instead of a larger one, because two meanings on one channel cannot both be read.
  • score_plot gains sizes, size_name and size_reference for the encoding and label_north for the label position; group_scatter gains areas. All are opt-in, so the DuPont and FMC figures are unchanged: regenerating the whole SBR set produces one changed PNG, batch-case-sbr-scores.png.

The book page's Plotly code is updated to match in kgdunn/pid-book#273, where the caption now states what the marker area means, and the prose quotes the two SPE ranks (echoed in the code, so the book's checker compares them).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE


Generated by Claude Code

…led above

The score plot showed only how extreme a batch is along the components. Its
marker area is now the batch's SPE, so one figure answers both questions asked
of a batch: batch 37, the furthest out along the first component, has the
smallest residual of the 53 batches, and batch 34 the twelfth smallest, which
is the point the influence plot beside it then makes with axes.

Area, not diameter, carries the value, and two grey circles in the legend give
the scale, without which an area cannot be read off a plot. A highlighted batch
keeps its own area and is marked by a heavier edge instead of a larger one,
because two meanings on one channel cannot both be read.

`score_plot` also takes `label_north`, for a label centred above its marker
rather than to its right; a label placed inside a cloud gets a white outline so
it reads over whatever it crosses. Batch 4 uses both.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE

kgdunn commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

CI on this head: "The colour case study, with pyoptex" passes, "Against process-improve main (advisory)" is still running, and "Against the PyPI release" fails, on the same blocker as #84 rather than on anything in this change.

That job installs process-improve from PyPI, which is still on 1.80.0. The three batch scripts import names that landed in kgdunn/process-improve#537 and are unreleased:

batch/batch-case-sbr-figures.py, line 63:
    from process_improve.batch import BatchMonitor, BatchPLS, load_sbr
ImportError: cannot import name 'BatchMonitor' from 'process_improve.batch'
42 scripts: 23 passed, 16 skipped, 3 failed

The three failures are the three batch scripts, and they were failing this way before this PR. Nothing in this repository fixes it: the job goes green when process-improve 1.81 reaches PyPI, which also clears the same two red checks on the book PR kgdunn/pid-book#273. The advisory job, which builds the library from main, should pass now that #537 is merged.

The change itself was checked by regenerating the whole SBR figure set against the merged library: one PNG differs, batch-case-sbr-scores.png, and the DuPont and FMC figures are byte-identical.


Generated by Claude Code

… read clearly

The batches span a factor of two in SPE, which as an area is a factor of two
and hard to judge across a scatter. The area now carries the square of the SPE,
a factor of four, and the sum of squared residuals is in any case the quantity
that adds up over the cells of a batch.

The legend key stays in the reader's units: `score_plot` takes
`size_of_reference`, which maps a reference value onto whatever scale the area
encodes, so the circle labelled "SPE 20" is the size a batch with an SPE of 20
is drawn. Three circles now, at 20, 30 and 40, spanning the batches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE
…er the grid

The scatter about the y = x line is what a reader judges on a parity plot, so
the number for it belongs on the same axes. Each panel's legend now lists
RMSEE, the scatter of the fitted values, and RMSEP, the same scatter when
every batch is left out of the fit in turn, each in the attribute's units and
in standard deviations of it.

The legend sits over the grid and close to the cloud, so it is drawn on white
at 85% opacity with no frame: readable, without reading as a panel of its own.

One leave-one-batch-out sweep now serves both figures that need it, its
end-of-batch row here and the whole frame in the prediction-error curve later,
rather than the script paying for it twice. The classical centre and spread in
the departure figure are renamed, since they shadowed the quality standard
deviations once that sweep moved above them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE
The RMSEP in the legend is a number; the band is the same thing as a distance,
so a reader can see at a glance which batches the model misses by more than it
should. Two RMSEP either side of y = x, drawn below the markers and above the
grid, with the band rather than the outermost batch setting the view.

`parity_plot` takes `band_from`, naming which of the errors it was given to
shade, and `band_multiple`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE
A legend drawn straight onto the panel has the grid, and sometimes the data,
running through its text. The shared style now gives every legend in these
figures a white ground at 85% opacity and no edge, so it reads wherever it
sits without becoming a panel of its own, and the parity plot drops the
explicit keywords it needed before.

Twenty-three figures across the three case studies change, in their legends
only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE
The three docstrings asked for 1.79 or 1.81, neither of which was ever
published; PyPI stands at 1.77.0. The loaders, the on-line methods and
the multiblock pieces these scripts import all ship in 1.82.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE

kgdunn commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Correcting two numbers in the comment above, now that the release version is settled.

"Against the PyPI release" fails on this head for the same reason and with the same tally (23 passed, 16 skipped, 3 failed; ImportError: cannot import name 'BatchPCA' / 'load_fmc' / 'BatchMonitor'). But PyPI is on 1.77.0, not 1.80.0: 1.78 through 1.81 were bumped on main and never published. The release that carries these names is 1.82.0, which is on main now that kgdunn/process-improve#549 has merged.

The last commit here updates the three script docstrings accordingly: they asked for "version 1.79 or later" and "1.81 or later", neither of which a reader could install.

The job is deterministic, so there is nothing to re-run: it goes green when 1.82.0 reaches PyPI, which also clears the two red checks on kgdunn/pid-book#273.


Generated by Claude Code

@kgdunn
kgdunn merged commit 2e16ccb into main Sep 7, 2026
5 of 6 checks passed
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.

2 participants