make_partitions
def make_partitions(y, *, method: str = 'stratified', fractions=(0.6, 0.2, 0.2), date=None, group=None, explicit: dict | None = None, seed: int = 42) -> compileml.select.Partitions
from compileml.select import make_partitions
Split rows into Fit, Select and Report.
- method="stratified" (default): stratified on the label.
- date: Report is the latest slice by date; Fit and Select are split
within the earlier period.
- group: split by group so one applicant lands in one partition. Not
stratified, which the method name records.
- explicit: {"fit": idx, "select": idx, "report": idx}, checked
for disjointness.
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| y | — | required | positional |
| method | str | 'stratified' | keyword-only |
| fractions | — | (0.6, 0.2, 0.2) | keyword-only |
| date | — | None | keyword-only |
| group | — | None | keyword-only |
| explicit | dict | None | None | keyword-only |
| seed | int | 42 | keyword-only |
Returns#
compileml.select.Partitions
Raises#
- ValueError
Read from the function body and the private helpers it calls, not inferred. A function that raises nothing has no section here.