[BUG] Guard default RidgeClassifierCV against LAPACK SVD overflow #3755
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 382 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3755"
general
weight: 0.35
aashoday
Reference Issues/PRs
Fixes #3737.
What does this implement/fix? Explain your changes.
Several classifiers (
RDSTClassifier,RocketClassifier,MultiRocketHydraClassifier)fit a default
RidgeClassifierCVon transformed feature matrices that can be too largefor 32-bit LAPACK to index. SciPy then raises
ValueError: Indexing a matrix of N, which does not say which aeonelements would incur an integer overflow in LAPACK
estimator failed or what to do about it.
This PR:
check_lapack_svd_safeinaeon.utils.validationto take the caught error.If it is SciPy's LAPACK integer overflow, it raises an informative
ValueErrorthatnames the estimator, gives the matrix shape, suggests a different estimator, and
chains the original error.
RDSTClassifier,RocketClassifierandMultiRocketHydraClassifierwhen fitting the default estimator fails. Other errors, and errors from custom
estimators, are not changed.
RocketClassifier.pipeline_. The steps are fitted manually and the pipeline isassembled from the fitted objects afterwards.
The first version of this PR predicted the failure from
n_samples * n_features. Thatis only correct for tall data on older scikit-learn (the SVD path), and it ignores
ILP64 SciPy builds, so the fit is now attempted and the real error is explained.
The
estimatorparameter ofMultiRocketHydraClassifierwas added separately in #4006.This PR does not address the separate 128GB OOM reported for
MultiRocketHydraClassifieron AustraliaRainfall_disc.Does your contribution introduce a new dependency? If yes, which one?
No.
Any other comments?
This PR targets only the LAPACK indexing bug not the separate 128GB OOM reported for
MultiRocketHydraClassifieronAustraliaRainfall_disc.AI was used to help understand parts of the codebase and LAPACK, scipy internals
while working through this fix; all changes were written and reviewed by me.
PR checklist
##### For all contributions
##### For new estimators and functions
__maintainer__at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.