feat: select on PR-AUC, cross-validate with a custom splitter#15
Merged
Conversation
Two robust-selection gaps in AutoML: - average_precision (PR-AUC) was reported on holdout but was NOT a selectable CV metric: fit(metric="average_precision") silently fell back to selecting on accuracy (scoring_name -> default). On imbalanced binary problems that picks the wrong winner. Now "average_precision" maps to sklearn's average_precision scorer, so the leaderboard, refit winner, and result.cv_scoring all reflect it. - AutoML(cv=...) is typed int only, yet cross_val_score already accepts a splitter. Broaden to `int | Any` and document/test passing TimeSeriesSplit (forward-chaining, no future leakage), StratifiedKFold, GroupKFold. TDD: PR-AUC tests RED->GREEN; splitter tests lock the now-documented contract. Docs: automl.md gains "cv accepts a splitter" + "select on PR-AUC" tips and the binary panel now lists average_precision + brier_score.
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.
What & why
Two robust model-selection gaps in
AutoML, closed with TDD on real data (breast_cancer):1. PR-AUC is now a selectable CV metric
average_precision(PR-AUC) was already reported on holdout, but it was not in the CV scoring map — sofit(metric="average_precision")silently fell back to selecting the winner on accuracy (scoring_name(...)→ default). On imbalanced binary problems, that picks the wrong model.Now
"average_precision"maps to scikit-learn'saverage_precisionscorer (greater-is-better), so the leaderboard, the refit winner, andresult.cv_scoringall reflect PR-AUC:2.
AutoML(cv=...)accepts a scikit-learn splittercvwas typedintonly, yet it's passed straight tocross_val_score, which already accepts any splitter. Broadened toint | Anyand documented + tested the cross-validation strategies that avoid silent leakage:Tests (TDD)
test_pr_auc_is_a_selectable_cv_metric,test_automl_selects_on_pr_auc— RED→GREEN (asserted'accuracy' == 'average_precision'before the fix).test_automl_accepts_a_cv_splitter,test_automl_accepts_a_time_series_splitter— lock the now-documentedcv-splitter contract.Docs
docs/automl.md: new "cvaccepts a splitter" and "select on PR-AUC for imbalanced binary" tips; the binary metric panel now listsaverage_precision+brier_score.