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#
| Name | Type | Default | Kind |
|---|---|---|---|
| latent | — | required | positional |
| n_bands | int | 10 | positional |
| method | str | 'quantile' | keyword-only |
| scale | int | 1000 | keyword-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)