Skip to content

Add PLS model-inversion null-space score-plot figure#59

Merged
kgdunn merged 5 commits into
mainfrom
claude/pid-book-opls-code-xzm6ef
Jul 23, 2026
Merged

Add PLS model-inversion null-space score-plot figure#59
kgdunn merged 5 commits into
mainfrom
claude/pid-book-opls-code-xzm6ef

Conversation

@kgdunn

@kgdunn kgdunn commented Jul 23, 2026

Copy link
Copy Markdown
Owner

What changed

A new figure for the pid-book PLS model-inversion page, with its matplotlib
generator committed alongside (the repo convention):

  • pls/pls-model-inversion-null-space.png
  • pls/pls-model-inversion-null-space.py

The figure is a two-component score plot of the cheddar-cheese model (trained on
cheeses 5 to 30), inverted toward a taste of 20.9. It shows the calibration
cheeses, the direct-inversion solution, the null space (the line of scores that
all predict the target taste), and the O-PLS orthogonal space projected into the
PLS score space. The null space and the projected orthogonal space coincide,
which is the point of the accompanying page and of García-Carrión et al. (2025).

The generator imports process_improve (PLS, OPLS) and follows the style of
the other modern scripts here (e.g. monitoring/adaptive-softsensor-figures.py):
mpl.use("Agg"), an output_dir argument defaulting to the script's directory,
and named colour constants.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01DsTypY4FcRbrXRxorb9raz


Generated by Claude Code

New figure for the pid-book PLS model-inversion page: a two-component score
plot of the cheddar-cheese model (trained on cheeses 5 to 30), inverted
toward a taste of 20.9. Shows the calibration cheeses, the direct-inversion
solution, the null space, and the O-PLS orthogonal space projected into the
PLS score space; the null space and the projected orthogonal space coincide.
Committed alongside its matplotlib generator, which imports process_improve.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DsTypY4FcRbrXRxorb9raz
claude added 4 commits July 23, 2026 21:23
…cond target

Recolours the main null-space line to orange, enlarges the O-PLS
orthogonal-space circles and thickens their edge, and adds a red dashed
null-space line for a second inversion (held-out cheese 4, taste 47.9). The
two null-space lines are parallel, since a single-response model has one
null-space direction and only the offset changes with the target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DsTypY4FcRbrXRxorb9raz
… line

Adds a purple dotted null-space line for the lowest held-out taste (cheese 1,
12.3), in a cool colour contrasting the warm orange and red. All three lines
are exactly parallel (shared direction g = [0.433, 0.902]); only the offset
shifts with the target, confirming that a single-response model has one fixed
null-space direction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DsTypY4FcRbrXRxorb9raz
The lines legend lists the null spaces from lowest to highest taste
(12.3, 20.9, 47.9); the markers legend holds the calibration cheeses, the
O-PLS orthogonal space, and the direct-inversion solution.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DsTypY4FcRbrXRxorb9raz
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