Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: op-group-quantile
description: Partition records into N equal-population quantile buckets (Q1..Q4 / D1..D10 / P1..P100).
kind: operator
category: GROUP
operator: GROUP_QUANTILE
type: reference
applies_to: process, compose, predict
examples_tags: [distribution-shape, buffered-pipeline]

Use when

Splits the rows into equal-sized groups by rank of a number, such as quartiles or deciles of spend, to compare top and bottom.

Questions it answers:

  • How do the top 25% of spenders differ from the bottom 25%?
  • What is the average basket in each decile of customer value?

Use something else:

  • GROUP_RANGE when you want bands of a fixed width, such as every 10 years of age.

Params

NameTypeDefaultDescription
intervalint4Number of buckets; the slot’s top-level interval, not params. 4 (quartiles), 10 (deciles), 100 (percentiles).
fitenumglobalglobal: cut once over the filtered set, any position. within: recut per bucket of the groupers before it (crosstab: rows, then columns); a no-op outermost. Each recut is a components buckets entry (group_key = the outer bucket); the slot floor stays the whole-set cut.

Weight (both kinds; "weight": null opts out): buckets cut at the weighted order statistics (the weighted-percentile rule; probability rescaled to the row count). A heavy row spanning a cut lands whole in the higher bucket; count / total_n stay raw rows.

Inputs

field — admitted types: see ## Contract; decimal128 reads as its float64 echo, packed_bool as 0/1.

Output

Bucket label per row (Qk / Dk / Pk). Rows emit in bucket order (D1, D2, …, D10, never D1, D10, D2) — grouped rows, groups composites, crosstab axes; keys stay unpadded. An explicit sort wins (sorting the key column compares strings).

Components

  • n_quantiles — Equal-population buckets
  • method — Interpolation ("linear")
  • edges — Sorted cutpoints
  • buckets — {key, low, high, count}

Contract

  • Types (field): date, datetime, decimal128, f32, f64, packed_bool, u16, u32, u4, u64, u8; any other scalar type is PULSE_FIELD_TYPE_UNSUPPORTED.
  • Weight: weighted under frequency and probability weights.
  • Streaming: buffered only; components none. Quantile cutoffs need the sorted value set; use GROUP_RANGE or GROUP_ROUNDED with known bounds for streaming.
  • Components: total_n, n_null, n_quantiles, method, edges, buckets.

Gotchas

  • Forces buffered execution — disables fused crosstab.
  • include on groups is refused (PROCESSING_CONFIG) — buckets are derived ranks; a crosstab axis keeps it for order.

See