compileml.bands

quantile_bands

def quantile_bands(latent, n_bands: int = 10, *, method: str = 'quantile', scale: int = 1000) -> compileml.bands.builders.BandSpec

from compileml.bands import quantile_bands

Plain quantile (or equal-width) bands; no outcome data required.

scale is the artifact's display scale, and edges that would collide once converted to integers at that scale are dropped rather than emitted. The result can therefore carry fewer bands than requested; the reduction is warned about and recorded in metadata["requested_n_bands"].

Parameters#

NameTypeDefaultKind
latent—requiredpositional
n_bandsint10positional
methodstr'quantile'keyword-only
scaleint1000keyword-only

Returns#

compileml.bands.builders.BandSpec

Raises#

  • ValueError

Read from the function body and the private helpers it calls, not inferred. A function that raises nothing has no section here.

Example#

python
from compileml.bands import quantile_bands
 
bands = quantile_bands(latent, n_bands=10)

Worked example: quantile_bands · monotone_quantile_bands →