Batch phase 3: sklearn transformer facades and f_rupture#461
Open
kgdunn wants to merge 1 commit into
Open
Conversation
Adds BaseEstimator/TransformerMixin facades over the existing batch free functions so a batch workflow can be an sklearn pipeline, with the learned state carried on the fitted estimator: BatchScaler (range scaling with inverse_transform), ResampleAligner (linear resampling to a common length), DTWAligner (iterative weighted DTW, learning a reference and weights and aligning new batches to them), and BatchFeatureExtractor (batch dict to a batch-by-feature matrix for PLS-to-quality). The free functions are unchanged and remain the implementation layer. Implements the previously-stubbed f_rupture via the optional ruptures library (PELT changepoint detection), and re-points the batch extra to ruptures - it previously declared openpyxl and scikit-image, which were imported nowhere. Bumps to 1.57.0 with CITATION, CHANGELOG, and docs updates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyEpexCyqHn1rwTMYQSiP6
6 tasks
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
BaseEstimator/TransformerMixinfacades over the existing batch free functions, so a batch workflow can be expressed as a pipeline and the learned state is carried on the fitted estimator:BatchScaler(range scaling withinverse_transform),ResampleAligner(linear resampling to a common length),DTWAligner(iterative weighted DTW that learns a reference and weights and aligns new batches to them), andBatchFeatureExtractor(a batch dict to a batch-by-feature matrix suitable as the X block of a PLS-to-quality model). The free functions are unchanged and remain the implementation layer.f_rupturevia the optionalruptureslibrary (PELT changepoint detection), and re-points thebatchextra toruptures- it previously declaredopenpyxlandscikit-image, which were imported nowhere.This is Phase 3 of the batch modernization plan (pipeline ergonomics + feature completion).
Note on base branch: stacked on
claude/batch-phase2-online-monitoring(#460), which is stacked on Phase 1 (#459). GitHub will retarget the base automatically as each parent merges. Review #459, then #460, then this.Test plan
tests/batch/test_transformers.py: scaler round-trip; resampler equal-length + auto-reference; DTW aligns the training set and a held-out batch to the reference length; feature matrix shape/index and feeding a PLS model; unknown-feature guard;f_rupturedetects an injected step (guarded byimportorskip("ruptures")) and rejects multi-column inputruff check .andmypy src/process_improvecleanChecklist
pyproject.toml(MINOR: 1.56.0 -> 1.57.0) andCITATION.cffsyncedruff check .passesCHANGELOG.mdupdated🤖 Generated with Claude Code
https://claude.ai/code/session_01SyEpexCyqHn1rwTMYQSiP6
Generated by Claude Code