Introduce yourself
Hello, I am a quant practitioner working at BNPP.
Describe the workflow you want to enable
Rank a feature's predictive strength against a binary target by binning it (equal-frequency or optimized) and computing Information Value: sum((pct_event - pct_nonevent) * log(pct_event / pct_nonevent)) over bins.
This is a standard univariate feature-screening step in binary classification, conceptually adjacent to things sklearn already ships in sklearn.feature_selection (mutual_info_classif, f_classif, chi2) as a way to rank/filter features before modeling. Notably this metric does not depends on imbalance.
Describe your proposed solution
'sklearn.metric.IV(X,y, bins=10) would be useful for establishing Information value. Then 'sklearn.feature_selection.information_value(X, y, bins=10)' returning per-feature IV, using equal-frequency quantile binning by default (fast, matches the common textbook definition).
Describe alternatives you've considered, if relevant
Checked scikit-learn's issue tracker for "Information Value" and "Weight of Evidence" - found nothing (no open request, no closed-as-declined). The realistic existing option is optbinning, a purpose-built, actively maintained package that solves actual bin optimization (via a CP/MIP solver) rather than plain quantile cuts.
IV/WOE binning is old and widely used, but specifically within credit-scoring-style binary classification rather than general ML - similar concern to the adjacent PSI request I'm also filing. Raising it mainly to get a maintainer judgment on record, since I couldn't find this discussed anywhere in scikit-learn's history.
Additional context
mutual_info_classif already covers "how predictive is this feature" in a distribution-agnostic way; IV specifically gives interpretable, additive-across-bins output that credit-risk practitioners rely on for regulatory model documentation, which is the main reason it persists as a distinct metric rather than being subsumed by mutual information in that field.
Warning
This issue is not yet ready for a PR. If you are interested in contributing to scikit-learn, please have a look at our contributing guidelines, and in particular the sections for new contributors and the "Needs triage" label.
Introduce yourself
Hello, I am a quant practitioner working at BNPP.
Describe the workflow you want to enable
Rank a feature's predictive strength against a binary target by binning it (equal-frequency or optimized) and computing Information Value:
sum((pct_event - pct_nonevent) * log(pct_event / pct_nonevent))over bins.This is a standard univariate feature-screening step in binary classification, conceptually adjacent to things sklearn already ships in
sklearn.feature_selection(mutual_info_classif,f_classif, chi2) as a way to rank/filter features before modeling. Notably this metric does not depends on imbalance.Describe your proposed solution
'sklearn.metric.IV(X,y, bins=10) would be useful for establishing Information value. Then 'sklearn.feature_selection.information_value(X, y, bins=10)' returning per-feature IV, using equal-frequency quantile binning by default (fast, matches the common textbook definition).
Describe alternatives you've considered, if relevant
Checked scikit-learn's issue tracker for "Information Value" and "Weight of Evidence" - found nothing (no open request, no closed-as-declined). The realistic existing option is
optbinning, a purpose-built, actively maintained package that solves actual bin optimization (via a CP/MIP solver) rather than plain quantile cuts.IV/WOE binning is old and widely used, but specifically within credit-scoring-style binary classification rather than general ML - similar concern to the adjacent PSI request I'm also filing. Raising it mainly to get a maintainer judgment on record, since I couldn't find this discussed anywhere in scikit-learn's history.
Additional context
mutual_info_classifalready covers "how predictive is this feature" in a distribution-agnostic way; IV specifically gives interpretable, additive-across-bins output that credit-risk practitioners rely on for regulatory model documentation, which is the main reason it persists as a distinct metric rather than being subsumed by mutual information in that field.