Quantile Partition Generator
Partitions sorted data into groups of as nearly equal count as the value structure permits, by placing each cut at the admissible position closest to the corresponding sample quantile.
This exists as a baseline. It uses no information about the shape of the data, so comparing a fitted result initialized this way against one initialized by a shape-aware generator isolates how much the initialization contributes. It is also the natural fallback when a shape-aware generator fails.
Cuts are snapped to admissible positions and then repaired left to right so that every group meets the size and distinct-value requirements. When the requirements cannot be met, null is returned rather than a partition that the caller would have to validate.
Properties
Functions
Generates a partition of the supplied sorted data into the requested number of groups, or returns null when no partition satisfying the certificate can be produced.