venn_abers/stratify-without-shuffle
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| venn_abers | error | none, edit by hand | All versions |
VennAbersCalibrator, VennAbersMultiClass, and VennAbersCV delegate inductive splitting to sklearn.model_selection.train_test_split, which raises ValueError: Stratified train/test split is not implemented for shuffle=False whenever stratify is set while shuffle=False (note that VennAbersCV and VennAbersMultiClass default to shuffle=False).
va = VennAbersCV(estimator=clf, inductive=True, cal_size=0.2, stratify=y_train)va = VennAbersCV(estimator=clf, inductive=True, cal_size=0.2, shuffle=True, stratify=y_train, random_state=0)What the rule reports
Section titled “What the rule reports”Calls to VennAbersCalibrator, VennAbersMultiClass, or VennAbersCV passing stratify=... with shuffle=False, or calls to VennAbersCV/VennAbersMultiClass passing stratify=... without shuffle=True.
How to fix it
Section titled “How to fix it”Pass shuffle=True alongside an integer random_state (for iid data), or omit stratify when keeping shuffle=False for chronological splits.
Diagnostic message
Section titled “Diagnostic message”Passing stratify with shuffle=False raises ValueError ("Stratified train/test split is not implemented for shuffle=False") inside train_test_split. Set shuffle=True with a fixed random_state or omit stratify.See all rules in the venn_abers pack.