跳转至

v0.6.8

Patch release closing the weighted-path audit opened by the 0.6.7 defect review: the G02 IV upper band now catches hard leakage on every screen path, and the G03/G04 selection-evidence chain plus G05/G06 ranking honor weight_col. All default-config and unweighted outputs are byte-identical to 0.6.7 (regression-asserted).

G02 IV Upper Band: Hard-Leak Coverage on All Paths

  • Defect (field case, FT-weighted CDC run): iv_upper_threshold dropped a leak feature on the unweighted monotone-engine path but not with weight_col set. Root cause was the IV basis, not the gate wiring: the weighted IV excludes class-degenerate bins (iv_guard), and a hard leak makes bins class-PURE — the strongest possible signal contributed nothing (a feature with engine IV ≈ 24 measured 0.6–1.7 weighted; fully-pure features measured 0.0). The legacy gains-table path zeroes pure bins the same way (filliv); only the monotone-engine report basis was immune.
  • Fix: _weighted_iv_detail computes, in the same pass, a zero-cell-FLOORED IV alongside the legacy degenerate-guarded IV — bin class shares floored at content (the PSI floor, default 1e-6), matching the WOE-engine convention; features without degenerate bins get iv_floored == iv exactly. When iv_upper_threshold is armed, every dispatch path gates the upper band on the floored IV; the gains-table and engine-IV paths obtain the diagnostic via a unit-weight floored computation.
  • Upper-band drops keep reason=iv_above_upper and now record metric=iv_floored with the floored value in dropped_detail. Reported iv_weighted values, iv_table column sets, warnings and ranking metrics stay on legacy semantics; iv_upper_threshold=None computes no floored IV at all.

G03/G04 Selection Evidence: Weighted Basis

  • Defect: the entire SelectionEvidence chain ignored weight_col — per-group IVs, per-target IVs and point-biserial directions were computed unweighted even when the pipeline ran weighted, so group-stability and multi-target gate decisions were made on a basis that does not match the modeling weights. (Investigation also corrected the 0.6.7 known-limitation wording: the evidence IV never had the iv_guard pure-bin exclusion — it uses the +1e-6 smoothed report formula.)
  • Fix: _evidence_iv and point_biserial_direction gain sample_weight; _build_selection_evidence resolves weight_col once on INS and re-slices positionally per group / per target. Weighted bincounts keep the same smoothing formula family as the ivks report; max(total, 1.0) floors are kept verbatim so a zero-mass slice degrades to iv == 0.0, never NaN.
  • The n column stays a raw observation count (min_group_n gauges statistical sufficiency, which weights do not add to). Stage-table column sets are unchanged; selection_config_snapshot records the new evidence_weight_col.
  • Unit-weight runs (weight_col of all 1.0) reproduce unweighted evidence tables bit-exactly; unweighted runs are byte-identical.

G05/G06 Ranking Basis: Conditional Floored Switch

  • Defect: gate_iv_map fed G05 truncation ranking and the G06 VIF tie-break the degenerate-guarded IV, so legitimate features with class-pure bins ranked artificially low and could be truncated in favor of weaker features.
  • Fix: new _gate_ranking_iv_map — when iv_upper_threshold is armed (leaks are already dropped by the band), finite floored IVs replace the guarded values for ranking; upper=None returns the legacy map verbatim (conservative against leaks). Behavior changes only under the doubly opt-in combination (upper band armed AND truncation/VIF armed).

Behavior Notes

  • Byte-identical outputs for default configs, unweighted runs, and iv_upper_threshold=None (regression-asserted, including bit-exact unit-weight parity).
  • Weight validation (NaN/inf/negative/all-zero raise) now fires at evidence build time for weighted runs with G03/G04 armed — the same exception class the weighted screen already raises, just earlier.
  • Known follow-up: legacy unarmed G05/G06 ranking still uses the per-path legacy IV bases (locked verbatim by regression tests); a basis unification remains available for a future minor if desired.

Validation

  • Full local pytest suite: 831 passed, 0 skipped (22 new regressions across the two batches: hard-leak upper band on four paths, weighted evidence flips, unit-weight parity, ranking-basis two-state).
  • CI green across the legacy/modern/bleeding × Python 3.11/3.12 matrix, source package checks, and version-consistency check.
  • Source package verification and wheel/sdist build passed (tasks.py verify).