Examples · Bands
governance_bands
The Welch t-test variant: adjacent bands must be statistically distinguishable before they are allowed to exist.
Code#
governance_bands.py
from _setup import latent, y_train from compileml.bands import governance_bands, semantic_bands committee = governance_bands(latent, y_train, max_bands=10, min_band_size=2000)discovered = semantic_bands(latent, y_train, max_bands=10, min_band_size=300) print("governance_bands :", len(committee.labels), "bands —", committee.labels)print("semantic_bands :", len(discovered.labels), "bands —", discovered.labels)print()print("Larger minimum band size and a stricter separation threshold buy")print("stability across refits, at the cost of resolution.")Output#
Captured from an actual run against compileml 0.9.0 and the UCI credit panel. If this script stops working, the build fails.
captured in CIgovernance_bands.py
governance_bands : 9 bands — ['G01', 'G02', 'G03', 'G04', 'G05', 'G06', 'G07', 'G08', 'G09']semantic_bands : 1 bands — ['G01'] Larger minimum band size and a stricter separation threshold buystability across refits, at the cost of resolution.Notes#
- Tighter alpha means fewer, wider, better-evidenced bands.