Batch phase 4: BatchPLS to final quality#462
Open
kgdunn wants to merge 1 commit into
Open
Conversation
BatchPLS mirrors BatchPCA's construction (unfold the batches batchwise, join an optional initial-conditions Z block onto the one-row-per-batch matrix) but fits the existing multivariate.PLS against a batch-indexed final-quality block Y. It relates the initial conditions and time-varying trajectory deviations to the final product quality, and predicts the quality of a completed batch. The X-weights keep the (tag, sequence) index so they reshape to a variable-by-time grid and plot with time_varying_loading_plot; predict and transform return results in the input batch order. Bumps to 1.58.0 with CITATION, CHANGELOG, and docs updates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyEpexCyqHn1rwTMYQSiP6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BatchPLS: batchwise-unfolded (multiway) PLS relating the unfolded[Z | X]batch matrix to a final-quality blockY(one row per batch), built by composition overmultivariate.PLS. It mirrorsBatchPCA's construction (batchwise unfold, optional initial-conditions Z join) but is supervised: it relates the initial conditions and time-varying trajectory deviations to the final product quality, and predicts the quality of a completed batch.(tag, sequence)index so they reshape to a variable-by-time grid and plot with the existingtime_varying_loading_plot.predictandtransformreturn results in the input batch order.This is Phase 4 (the final phase) of the batch modernization plan: the batch regression / prediction counterpart to
BatchPCA.Note on base branch: stacked on
claude/batch-phase3-transformers(#461) → #460 → #459. GitHub retargets the base automatically as each parent merges. Review order: #459, #460, #461, then this.Test plan
tests/batch/test_batch_pls.py: fit + predict on the real dryer dataset (scores shape, MultiIndex weights, R2, prediction correlates with quality); weights reshape to a (tag, time) grid; Z-block join; a synthetic batch whose quality is a known function of its trajectories is recovered; Y type/index guards; wrong-length rejection; transform returns scoresruff check .andmypy src/process_improveclean (144 files)Note on the OWU phase
The originally-planned Phase 4 was observationwise unfolding (OWU / OWU-TBWU) plus maturity-variable alignment. Per your steer, OWU was dropped (batchwise unfolding only, one row per batch, Z included), so this phase delivers
BatchPLSon that same[Z | X]matrix instead.Checklist
pyproject.toml(MINOR: 1.57.0 -> 1.58.0) andCITATION.cffsyncedruff check .passesCHANGELOG.mdupdated🤖 Generated with Claude Code
https://claude.ai/code/session_01SyEpexCyqHn1rwTMYQSiP6
Generated by Claude Code